Code Monkey home page Code Monkey logo

aiolyric's Introduction

Hello! πŸ‘‹

My name is Aidan, but you might know me better as Timmo or @timmo001

timmo001's GitHub stats timmo001's Top Languages

Contact / Social

Tips

If you like my work and want to send a tip my way, you can find links below on one-time payment or an ongoing sponsorship. Thank you in advance for any contribution! πŸ‘

Recent Activity

  1. πŸŽ‰ Merged PR #7 in timmo001/stats-overlay
  2. πŸ’ͺ Opened PR #7 in timmo001/stats-overlay
  3. πŸš€ Published release 1.0.0 in timmo001/stats-overlay
  4. ❌ Closed PR #3 in timmo001/stats-overlay
  5. πŸŽ‰ Merged PR #2 in timmo001/stats-overlay
  6. πŸ’ͺ Opened PR #2168 in timmo001/home-panel
  7. πŸŽ‰ Merged PR #2165 in timmo001/home-panel
  8. πŸ’ͺ Opened PR #2165 in timmo001/home-panel
  9. ❗️ Opened issue #2162 in timmo001/home-panel
  10. πŸŽ‰ Merged PR #2161 in timmo001/home-panel

➑️ More Activity


aiolyric's People

Contributors

apt-itude avatar bdraco avatar dalinicus avatar dependabot[bot] avatar fabaff avatar nprez83 avatar timmo001 avatar yraghu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

aiolyric's Issues

The `Lyric.rooms_dict` property has an incorrect type signature

Description

The _rooms_dict member is a nested dictionary of LyricRoom objects keyed by mac ID, then room ID, but the rooms_dict property that wraps it claims to return a type of dict[str, LyricRoom]. This causes type errors when using the client.

How to reproduce the issue (if applicable)

Use the rooms_dict property in a type-checked codebase.

Screenshots (if applicable)

Additional information

Support water leak sensors

Description

At the moment this library is assuming that it never interacts with a water leak detector. For example the device dict is using the MAC to identify each device, but this is not present and thus only at most one device works (each detector is overwriting the previous ones).

Additionally there are other fields which aren't available (e.g. waterPresent) which would be nice.

Suggested Actions

I was wondering whether it would be possible to use the deviceID for the keys of the device dict. Obviously for backwards compatability it would have to use a new dictionary.

Also add properties to read the other fields which aren't present in the library but through the API. Although that is not as important as it is possible to get them through the attributes field of the device.

Test failure

During the build process for the NixOS package, there is a test failure.

============================= test session starts ==============================
platform linux -- Python 3.8.8, pytest-6.1.2, py-1.9.0, pluggy-0.13.1
rootdir: /build/source
collected 2 items                                                              

tests/objects/test_device.py .                                           [ 50%]
tests/objects/test_location.py F                                         [100%]

=================================== FAILURES ===================================
________________________________ test_location _________________________________

location_fixture_response = {'comfortLevel': 0, 'configuration': {'faceRecognition': {'enabled': False, 'maxEtaPersons': 1, 'maxEtas': 2, 'maxPersons': 10, ...}}, 'country': 'GB', 'daylightSavingTimeEnabled': True, ...}

    def test_location(location_fixture_response):
        obj = LyricLocation(None, location_fixture_response)
        assert obj.locationID == location_fixture_response["locationID"]
        assert obj.name == location_fixture_response["name"]
        assert obj.country == location_fixture_response["country"]
        assert obj.zipcode == location_fixture_response["zipcode"]
        assert (
            obj.devices[0].displayedOutdoorHumidity
            == location_fixture_response["devices"][0]["displayedOutdoorHumidity"]
        )
        assert (
            obj.devices[0].vacationHold.enabled
            == location_fixture_response["devices"][0]["vacationHold"]["enabled"]
        )
>       assert (
            obj.devices[0].currentSchedulePeriod
            == location_fixture_response["devices"][0]["currentSchedulePeriod"]
        )
E       AssertionError: assert <aiolyric.objects.device.Currentscheduleperiod object at 0x7ffff5e349a0> == {'day': 'Monday', 'period': 'P2'}
E        +  where <aiolyric.objects.device.Currentscheduleperiod object at 0x7ffff5e349a0> = <aiolyric.objects.device.LyricDevice object at 0x7ffff5e348e0>.currentSchedulePeriod

tests/objects/test_location.py:22: AssertionError
=========================== short test summary info ============================
FAILED tests/objects/test_location.py::test_location - AssertionError: assert...
========================= 1 failed, 1 passed in 0.21s ==========================

I guess that this will happens to other consumers too.

test_priority fails with AssertionError on 1.1.0

Description

We're seeing the following test fail on 1.1.0 with python 3.11.4, pytest 7.4.0, aiohttp 3.8.5.

________________________________ test_priority _________________________________

priority_fixture_response = {'currentPriority': {'priorityType': 'PickARoom', 'rooms': [{'accessories': [{'detectMotion': False, 'excludeMotion': ...allMotion': False, 'roomAvgHumidity': 52, ...}], 'selectedRooms': [0]}, 'deviceId': '00A01AB1ABCD', 'status': 'NoHold'}

    def test_priority(priority_fixture_response):
        obj = LyricPriority(priority_fixture_response)
        assert obj.deviceId == priority_fixture_response['deviceId']
        assert obj.status == priority_fixture_response['status']
        assert obj.currentPriority.priorityType == priority_fixture_response['currentPriority']['priorityType']
        assert obj.currentPriority.selectedRooms[0] == priority_fixture_response['currentPriority']['selectedRooms'][0]
        assert obj.currentPriority.rooms[0].id == priority_fixture_response['currentPriority']['rooms'][0]['id']
        assert obj.currentPriority.rooms[0].roomName == priority_fixture_response['currentPriority']['rooms'][0]['roomName']
        assert obj.currentPriority.rooms[0].roomAvgTemp == priority_fixture_response['currentPriority']['rooms'][0]['roomAvgTemp']
        assert obj.currentPriority.rooms[0].roomAvgHumidity == priority_fixture_response['currentPriority']['rooms'][0]['roomAvgHumidity']
        assert obj.currentPriority.rooms[0].overallMotion == priority_fixture_response['currentPriority']['rooms'][0]['overallMotion']
>       assert obj.currentPriority.rooms[0].accessories == priority_fixture_response['currentPriority']['rooms'][0]['accessories']
E       AssertionError: assert [<aiolyric.objects.priority.LyricAccessories object at 0x7ffff56e19d0>] == [{'id': 0, 'type': 'Thermostat', 'excludeTemp': False, 'excludeMotion': False, 'temperature': 75.828, 'status': 'Ok', 'detectMotion': False}]
E         At index 0 diff: <aiolyric.objects.priority.LyricAccessories object at 0x7ffff56e19d0> != {'id': 0, 'type': 'Thermostat', 'excludeTemp': False, 'excludeMotion': False, 'temperature': 75.828, 'status': 'Ok', 'detectMotion': False}
E         Full diff:
E           [
E         +  <aiolyric.objects.priority.LyricAccessories object at 0x7ffff56e19d0>,
E         -  {'detectMotion': False,
E         -   'excludeMotion': False,
E         -   'excludeTemp': False,
E         -   'id': 0,
E         -   'status': 'Ok',
E         -   'temperature': 75.828,
E         -   'type': 'Thermostat'},
E           ]

tests/objects/test_priority.py:18: AssertionError

How to reproduce the issue (if applicable)

Run the test suite.

Additional information

Hot Water control

Description

Devices such as the T6R-HW support controlling hot water and heating separately. Currently this library only supports controlling the heating so it would be good to also be able to control the hot water.

Suggested Actions

Add support for:

  • Get hot water state
  • Set hot water state
  • Get boost duration
  • Set boost duration
  • Get/update hot water schedule?

Additional

The device attributes contains the following which references the hot water:

    "dhwZone": {
        "deviceId": "<ID>",
        "deviceClass": "DHW",
        "deviceType": "DHW",
        "dhw": {
            "dhwState": "Off",
            "status": "TemporaryHold",
            "boostDuration": 0,
            "vacationHold": {
                "enabled": true
            },
            "geoBoostEnabled": false,
            "nextPeriodTime": "06: 00: 00"
        },
        "currentSchedulePeriod": {
            "day": "Saturday",
            "period": "P2"
        }
    },

Set Fan implementation?

This is great!! Thanks!

Any chance to implement fan settings as per the API?

I can manually curl it, but would love to see it integrated here :)
"settings": { "fan": { "allowedModes": [ "On", "Auto", "Circulate" ], "changeableValues": { "mode": "On" } }, }

Implement fan modes

Description

Quick question @timmo001, I was trying to test the code changes I've made to the climate.py file in my lyric integration to enable fan control, but I'm still getting the error stating LyricDevice does not have a fan property, which is what this PR should have accomplished. I'm still new to pull requests etc. so just wondering how to go about getting my updated climate.py to access the updated aiolyric. Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.