Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct firmware for fans #270

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Correct firmware for fans

5636bfd
Select commit
Loading
Failed to load commit list.
Open

Correct firmware for fans #270

Correct firmware for fans
5636bfd
Select commit
Loading
Failed to load commit list.
Azure Pipelines / webdjoe.pyvesync failed Jan 25, 2025 in 1m 43s

Build #20250124.9 had test failures

Details

Tests

  • Failed: 15 (1.38%)
  • Passed: 1,071 (98.62%)
  • Other: 0 (0.00%)
  • Total: 1,086

Annotations

Check failure on line 41 in Build log

@azure-pipelines azure-pipelines / webdjoe.pyvesync

Build log #L41

Bash exited with code '1'.

Check failure on line 3640 in Build log

@azure-pipelines azure-pipelines / webdjoe.pyvesync

Build log #L3640

5 test(s) failed, 362 test(s) collected.

Check failure on line 4157 in Build log

@azure-pipelines azure-pipelines / webdjoe.pyvesync

Build log #L4157

Bash exited with code '1'.

Check failure on line 3640 in Build log

@azure-pipelines azure-pipelines / webdjoe.pyvesync

Build log #L3640

5 test(s) failed, 362 test(s) collected.

Check failure on line 1 in src/tests/test_fans.py::TestAirPurifiers::test_details[air_purifiers.Core200S.update]

@azure-pipelines azure-pipelines / webdjoe.pyvesync

src/tests/test_fans.py::TestAirPurifiers::test_details[air_purifiers.Core200S.update]

self = <test_fans.TestAirPurifiers object at 0x7fc94e4f3820>
dev_type = 'Core200S', method = 'update'

    def test_details(self, dev_type, method):
        """Test the device details API request and response.
    
        This method is automatically parametrized by `pytest_generate_tests`
        based on class variables `device` (name of device type - air_purifiers),
        device name (air_purifiers) list of device types.
    
        Example:
            >>> device = 'air_purifiers'
            >>> air_purifiers = call_json_fans.AIR_MODELS
    
        See Also
        --------
        `utils.TestBase` class docstring
        `call_json_fans` module docstring
    
        Notes
        ------
        The device is instantiated using the `call_json.DeviceList.device_list_item()`
        method. The device details contain the default values set in `utils.Defaults`
        """
        # Set return value for call_api based on call_json_fan.DETAILS_RESPONSES
        return_val = call_json_fans.DETAILS_RESPONSES[dev_type]
        self.mock_api.return_value = return_val
    
        # Instantiate device from device list return item
        device_config = call_json.DeviceList.device_list_item(dev_type)
        _, fan_obj = object_factory(dev_type,
                                    device_config,
                                    self.manager)
        method_call = getattr(fan_obj, method)
>       method_call()

src/tests/test_fans.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/pyvesync/vesyncfan.py:434: in update
    self.get_details()
src/pyvesync/vesyncfan.py:422: in get_details
    self.build_purifier_dict(inner_result)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = DevClass: VeSyncAirBypass,                Name:Core200S-NAME, Device No: 0,                DevStatus: on, CID: Core200S-CID
dev_dict = {'air_quality': 3, 'air_quality_value': 4, 'child_lock': True, 'configuration': {'auto_preference': {'room_size': 0, 'type': 'default'}, 'display': True, 'display_forever': True}, ...}

    def build_purifier_dict(self, dev_dict: dict) -> None:
        """Build Bypass purifier status dictionary.
    
        Populates `self.details` and instance variables with device details.
    
        Args:
            dev_dict (dict): Dictionary of device details from API
    
        Examples:
            >>> dev_dict = {
            ...     'enabled': True,
            ...     'filter_life': 0,
            ...     'mode': 'manual',
            ...     'level': 0,
            ...     'display': False,
            ...     'child_lock': False,
            ...     'night_light': 'off',
            ...     'display': False,
            ...     'display_forever': False,
            ...     'air_quality_value': 0,
            ...     'air_quality': 0
            ... }
            >>> build_purifier_dict(dev_dict)
            >>> print(self.details)
            {
                'filter_life': 0,
                'mode': 'manual',
                'level': 0,
                'display': False,
                'child_lock': False,
                'night_light': 'off',
                'display': False,
                'display_forever': False,
                'air_quality_value': 0,
                'air_quality': 0
            }
        """
        self.enabled = dev_dict.get('enabled', False)
        if self.enabled:
            self.device_status = 'on'
        else:
            self.device_status = 'off'
        self.details['filter_life'] = dev_dict.get('filter_life', 0)
        self.mode = dev_dict.get('mode', 'manual')
        self.speed = dev_dict.get('level', 0)
        self.details['display'] = dev_dict.get('display', False)
        self.details['child_lock'] = dev_dict.get('child_lock', False)
        self.details['night_light'] = dev_dict.get('night_light', 'off')
        self.details['display']
Raw output
/home/vsts/work/1/s/src/pyvesync/vesyncfan.py:376: NameError: name 'r' is not defined

Check failure on line 1 in src/tests/test_fans.py::TestAirPurifiers::test_details[air_purifiers.Core300S.update]

@azure-pipelines azure-pipelines / webdjoe.pyvesync

src/tests/test_fans.py::TestAirPurifiers::test_details[air_purifiers.Core300S.update]

self = <test_fans.TestAirPurifiers object at 0x7fc94e4ea190>
dev_type = 'Core300S', method = 'update'

    def test_details(self, dev_type, method):
        """Test the device details API request and response.
    
        This method is automatically parametrized by `pytest_generate_tests`
        based on class variables `device` (name of device type - air_purifiers),
        device name (air_purifiers) list of device types.
    
        Example:
            >>> device = 'air_purifiers'
            >>> air_purifiers = call_json_fans.AIR_MODELS
    
        See Also
        --------
        `utils.TestBase` class docstring
        `call_json_fans` module docstring
    
        Notes
        ------
        The device is instantiated using the `call_json.DeviceList.device_list_item()`
        method. The device details contain the default values set in `utils.Defaults`
        """
        # Set return value for call_api based on call_json_fan.DETAILS_RESPONSES
        return_val = call_json_fans.DETAILS_RESPONSES[dev_type]
        self.mock_api.return_value = return_val
    
        # Instantiate device from device list return item
        device_config = call_json.DeviceList.device_list_item(dev_type)
        _, fan_obj = object_factory(dev_type,
                                    device_config,
                                    self.manager)
        method_call = getattr(fan_obj, method)
>       method_call()

src/tests/test_fans.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/pyvesync/vesyncfan.py:434: in update
    self.get_details()
src/pyvesync/vesyncfan.py:422: in get_details
    self.build_purifier_dict(inner_result)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = DevClass: VeSyncAirBypass,                Name:Core300S-NAME, Device No: 0,                DevStatus: on, CID: Core300S-CID
dev_dict = {'air_quality': 3, 'air_quality_value': 4, 'child_lock': True, 'configuration': {'auto_preference': {'room_size': 0, 'type': 'default'}, 'display': True, 'display_forever': True}, ...}

    def build_purifier_dict(self, dev_dict: dict) -> None:
        """Build Bypass purifier status dictionary.
    
        Populates `self.details` and instance variables with device details.
    
        Args:
            dev_dict (dict): Dictionary of device details from API
    
        Examples:
            >>> dev_dict = {
            ...     'enabled': True,
            ...     'filter_life': 0,
            ...     'mode': 'manual',
            ...     'level': 0,
            ...     'display': False,
            ...     'child_lock': False,
            ...     'night_light': 'off',
            ...     'display': False,
            ...     'display_forever': False,
            ...     'air_quality_value': 0,
            ...     'air_quality': 0
            ... }
            >>> build_purifier_dict(dev_dict)
            >>> print(self.details)
            {
                'filter_life': 0,
                'mode': 'manual',
                'level': 0,
                'display': False,
                'child_lock': False,
                'night_light': 'off',
                'display': False,
                'display_forever': False,
                'air_quality_value': 0,
                'air_quality': 0
            }
        """
        self.enabled = dev_dict.get('enabled', False)
        if self.enabled:
            self.device_status = 'on'
        else:
            self.device_status = 'off'
        self.details['filter_life'] = dev_dict.get('filter_life', 0)
        self.mode = dev_dict.get('mode', 'manual')
        self.speed = dev_dict.get('level', 0)
        self.details['display'] = dev_dict.get('display', False)
        self.details['child_lock'] = dev_dict.get('child_lock', False)
        self.details['night_light'] = dev_dict.get('night_light', 'off')
        self.details['display']
Raw output
/home/vsts/work/1/s/src/pyvesync/vesyncfan.py:376: NameError: name 'r' is not defined

Check failure on line 1 in src/tests/test_fans.py::TestAirPurifiers::test_details[air_purifiers.Core400S.update]

@azure-pipelines azure-pipelines / webdjoe.pyvesync

src/tests/test_fans.py::TestAirPurifiers::test_details[air_purifiers.Core400S.update]

self = <test_fans.TestAirPurifiers object at 0x7fc94e4ea040>
dev_type = 'Core400S', method = 'update'

    def test_details(self, dev_type, method):
        """Test the device details API request and response.
    
        This method is automatically parametrized by `pytest_generate_tests`
        based on class variables `device` (name of device type - air_purifiers),
        device name (air_purifiers) list of device types.
    
        Example:
            >>> device = 'air_purifiers'
            >>> air_purifiers = call_json_fans.AIR_MODELS
    
        See Also
        --------
        `utils.TestBase` class docstring
        `call_json_fans` module docstring
    
        Notes
        ------
        The device is instantiated using the `call_json.DeviceList.device_list_item()`
        method. The device details contain the default values set in `utils.Defaults`
        """
        # Set return value for call_api based on call_json_fan.DETAILS_RESPONSES
        return_val = call_json_fans.DETAILS_RESPONSES[dev_type]
        self.mock_api.return_value = return_val
    
        # Instantiate device from device list return item
        device_config = call_json.DeviceList.device_list_item(dev_type)
        _, fan_obj = object_factory(dev_type,
                                    device_config,
                                    self.manager)
        method_call = getattr(fan_obj, method)
>       method_call()

src/tests/test_fans.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/pyvesync/vesyncfan.py:434: in update
    self.get_details()
src/pyvesync/vesyncfan.py:422: in get_details
    self.build_purifier_dict(inner_result)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = DevClass: VeSyncAirBypass,                Name:Core400S-NAME, Device No: 0,                DevStatus: on, CID: Core400S-CID
dev_dict = {'air_quality': 3, 'air_quality_value': 4, 'child_lock': True, 'configuration': {'auto_preference': {'room_size': 0, 'type': 'default'}, 'display': True, 'display_forever': True}, ...}

    def build_purifier_dict(self, dev_dict: dict) -> None:
        """Build Bypass purifier status dictionary.
    
        Populates `self.details` and instance variables with device details.
    
        Args:
            dev_dict (dict): Dictionary of device details from API
    
        Examples:
            >>> dev_dict = {
            ...     'enabled': True,
            ...     'filter_life': 0,
            ...     'mode': 'manual',
            ...     'level': 0,
            ...     'display': False,
            ...     'child_lock': False,
            ...     'night_light': 'off',
            ...     'display': False,
            ...     'display_forever': False,
            ...     'air_quality_value': 0,
            ...     'air_quality': 0
            ... }
            >>> build_purifier_dict(dev_dict)
            >>> print(self.details)
            {
                'filter_life': 0,
                'mode': 'manual',
                'level': 0,
                'display': False,
                'child_lock': False,
                'night_light': 'off',
                'display': False,
                'display_forever': False,
                'air_quality_value': 0,
                'air_quality': 0
            }
        """
        self.enabled = dev_dict.get('enabled', False)
        if self.enabled:
            self.device_status = 'on'
        else:
            self.device_status = 'off'
        self.details['filter_life'] = dev_dict.get('filter_life', 0)
        self.mode = dev_dict.get('mode', 'manual')
        self.speed = dev_dict.get('level', 0)
        self.details['display'] = dev_dict.get('display', False)
        self.details['child_lock'] = dev_dict.get('child_lock', False)
        self.details['night_light'] = dev_dict.get('night_light', 'off')
        self.details['display']
Raw output
/home/vsts/work/1/s/src/pyvesync/vesyncfan.py:376: NameError: name 'r' is not defined

Check failure on line 1 in src/tests/test_fans.py::TestAirPurifiers::test_details[air_purifiers.Core600S.update]

@azure-pipelines azure-pipelines / webdjoe.pyvesync

src/tests/test_fans.py::TestAirPurifiers::test_details[air_purifiers.Core600S.update]

self = <test_fans.TestAirPurifiers object at 0x7fc94e4eac10>
dev_type = 'Core600S', method = 'update'

    def test_details(self, dev_type, method):
        """Test the device details API request and response.
    
        This method is automatically parametrized by `pytest_generate_tests`
        based on class variables `device` (name of device type - air_purifiers),
        device name (air_purifiers) list of device types.
    
        Example:
            >>> device = 'air_purifiers'
            >>> air_purifiers = call_json_fans.AIR_MODELS
    
        See Also
        --------
        `utils.TestBase` class docstring
        `call_json_fans` module docstring
    
        Notes
        ------
        The device is instantiated using the `call_json.DeviceList.device_list_item()`
        method. The device details contain the default values set in `utils.Defaults`
        """
        # Set return value for call_api based on call_json_fan.DETAILS_RESPONSES
        return_val = call_json_fans.DETAILS_RESPONSES[dev_type]
        self.mock_api.return_value = return_val
    
        # Instantiate device from device list return item
        device_config = call_json.DeviceList.device_list_item(dev_type)
        _, fan_obj = object_factory(dev_type,
                                    device_config,
                                    self.manager)
        method_call = getattr(fan_obj, method)
>       method_call()

src/tests/test_fans.py:147: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/pyvesync/vesyncfan.py:434: in update
    self.get_details()
src/pyvesync/vesyncfan.py:422: in get_details
    self.build_purifier_dict(inner_result)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = DevClass: VeSyncAirBypass,                Name:Core600S-NAME, Device No: 0,                DevStatus: on, CID: Core600S-CID
dev_dict = {'air_quality': 3, 'air_quality_value': 4, 'child_lock': True, 'configuration': {'auto_preference': {'room_size': 0, 'type': 'default'}, 'display': True, 'display_forever': True}, ...}

    def build_purifier_dict(self, dev_dict: dict) -> None:
        """Build Bypass purifier status dictionary.
    
        Populates `self.details` and instance variables with device details.
    
        Args:
            dev_dict (dict): Dictionary of device details from API
    
        Examples:
            >>> dev_dict = {
            ...     'enabled': True,
            ...     'filter_life': 0,
            ...     'mode': 'manual',
            ...     'level': 0,
            ...     'display': False,
            ...     'child_lock': False,
            ...     'night_light': 'off',
            ...     'display': False,
            ...     'display_forever': False,
            ...     'air_quality_value': 0,
            ...     'air_quality': 0
            ... }
            >>> build_purifier_dict(dev_dict)
            >>> print(self.details)
            {
                'filter_life': 0,
                'mode': 'manual',
                'level': 0,
                'display': False,
                'child_lock': False,
                'night_light': 'off',
                'display': False,
                'display_forever': False,
                'air_quality_value': 0,
                'air_quality': 0
            }
        """
        self.enabled = dev_dict.get('enabled', False)
        if self.enabled:
            self.device_status = 'on'
        else:
            self.device_status = 'off'
        self.details['filter_life'] = dev_dict.get('filter_life', 0)
        self.mode = dev_dict.get('mode', 'manual')
        self.speed = dev_dict.get('level', 0)
        self.details['display'] = dev_dict.get('display', False)
        self.details['child_lock'] = dev_dict.get('child_lock', False)
        self.details['night_light'] = dev_dict.get('night_light', 'off')
        self.details['display']
Raw output
/home/vsts/work/1/s/src/pyvesync/vesyncfan.py:376: NameError: name 'r' is not defined