Python Wrapper for Homeassistant's REST API

Overview

HomeassistantAPI

Lines of code PyPI - Downloads GitHub commits since latest release (by date including pre-releases) Read the Docs (version) GitHub release (latest by date) GitHub release (latest by date)

Homeassistant Logo

Python Wrapper for Homeassistant's REST API

Please ⭐️ the repo if you find this project useful or cool!

Here is a quick example.

from homeassistant_api import Client

client = Client(
    '<API URL>',
    '<Long Lived Access Token>'
)

services = client.get_domains()

services.light.turn_on.trigger(entity_id='light.living_room_lamp')

Documentation

All documentation, API reference, Contribution guidelines and pretty much everything else you'd want to know is on our readthedocs site here

If theres something missing open an issue and let us know! Thanks!

Go make some cool stuff! Maybe come back and tell us about it in a discussion? We'd love to hear about how you use our library!!

Comments
  • Malformed entity id. Broken `get_state` API

    Malformed entity id. Broken `get_state` API

    Calling get_state will always result in a malformed entity_id error.

    state = self.client.get_state(self._entity_id)
    File "/usr/local/lib/python3.8/site-packages/homeassistant_api/client.py", line 207, in get_state
    raise MalformedInputError(f"The entity_id, {entity_id!r}, is malformed")
    homeassistant_api.errors.MalformedInputError: The entity_id, 'light.amirlight', is malformed
    

    I have pinpointed the problem to be in the malformed_id function. https://github.com/GrandMoff100/HomeAssistantAPI/blob/master/homeassistant_api/client.py#L123

    The 4th check here entity_id.lower() == entity_id will always evaluate to True, causing the malformed checker to return True. This should be entity_id.lower() != entity_id imo.

    The bug must be introduced in the latest version as it was working fine for me before.

    bug 
    opened by bramstroker 11
  • Using synchronously seems to require async?

    Using synchronously seems to require async?

    I'm trying to do some really basic stuff but I can't get it to work:

    from homeassistant_api import Client
    
    import pprint
    import os
    
    def fetch_homeassistant_data():
      url = os.getenv('HOMEASSISTANT_URL')
      token = os.getenv("HOMEASSISTANT_TOKEN")
    
      assert token is not None
    
      with Client(url, token) as client:
        sun = client.get_entity(entity_id="sun.sun")
        state = sun.get_state()
    
        pprint(state)
    

    throws this error:

      File "/Users/wil/Code/solar-frame/solarframe/ha_data.py", line 12, in fetch_homeassistant_data
        with Client(url, token) as client:
      File "/Users/wil/.local/share/virtualenvs/solar-frame-gF3PVx5E/lib/python3.9/site-packages/homeassistant_api/client.py", line 25, in __init__
        super().__init__(*args, **kwargs)
      File "/Users/wil/.local/share/virtualenvs/solar-frame-gF3PVx5E/lib/python3.9/site-packages/homeassistant_api/rawclient.py", line 58, in __init__
        super().__init__(*args, **kwargs)
      File "/Users/wil/.local/share/virtualenvs/solar-frame-gF3PVx5E/lib/python3.9/site-packages/homeassistant_api/rawasyncclient.py", line 63, in __init__
        self.async_cache_session = aiohttp_client_cache.CachedSession(
      File "/Users/wil/.local/share/virtualenvs/solar-frame-gF3PVx5E/lib/python3.9/site-packages/forge/_revision.py", line 328, in inner
        return callable(*mapped.args, **mapped.kwargs)
      File "/Users/wil/.local/share/virtualenvs/solar-frame-gF3PVx5E/lib/python3.9/site-packages/aiohttp_client_cache/session.py", line 37, in __init__
        super().__init__(**session_kwargs)
      File "/Users/wil/.local/share/virtualenvs/solar-frame-gF3PVx5E/lib/python3.9/site-packages/aiohttp/client.py", line 227, in __init__
        loop = get_running_loop(loop)
      File "/Users/wil/.local/share/virtualenvs/solar-frame-gF3PVx5E/lib/python3.9/site-packages/aiohttp/helpers.py", line 288, in get_running_loop
        loop = asyncio.get_event_loop()
      File "/opt/homebrew/Cellar/[email protected]/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/events.py", line 642, in get_event_loop
        raise RuntimeError('There is no current event loop in thread %r.'
    RuntimeError: There is no current event loop in thread 'Thread-1'.
    ----------------------------------------
    Exception ignored in: <function ClientSession.__del__ at 0x1067ad430>
    Traceback (most recent call last):
      File "/Users/wil/.local/share/virtualenvs/solar-frame-gF3PVx5E/lib/python3.9/site-packages/aiohttp/client.py", line 336, in __del__
        if not self.closed:
      File "/Users/wil/.local/share/virtualenvs/solar-frame-gF3PVx5E/lib/python3.9/site-packages/aiohttp/client.py", line 986, in closed
        return self._connector is None or self._connector.closed
    AttributeError: 'CachedSession' object has no attribute '_connector'
    
    bug 
    opened by wilg 8
  • [Library Bug] Bug from #99: methods with join call broken

    [Library Bug] Bug from #99: methods with join call broken

    Describe the bug Methods like get_state, set_state, trigger_service & fire_event are broken since #99

    To Reproduce This simple code snippet fails:

    api_url = "https://somemy.domain.com/api"
    token = 'MYTOKEN'
    with Client(
        api_url,
        token,
    ) as ha_client:
        temperature = ha_client.get_state(entity_id='sensor.temperature')
    

    Stack trace:

    Traceback (most recent call last):
      File "/Users/kizill/repo/bolotov_info_bot/playground.py", line 29, in <module>
        ha_client.get_state(entity_id='sensor.temperature')
      File "/opt/homebrew/Caskroom/miniconda/base/envs/tg_bot/lib/python3.10/site-packages/homeassistant_api/rawclient.py", line 233, in get_state
        data = self.request(join("states", entity_id))
      File "/opt/homebrew/Caskroom/miniconda/base/envs/tg_bot/lib/python3.10/site-packages/homeassistant_api/rawclient.py", line 76, in request
        return self.response_logic(resp)
      File "/opt/homebrew/Caskroom/miniconda/base/envs/tg_bot/lib/python3.10/site-packages/homeassistant_api/rawclient.py", line 81, in response_logic
        return Processing(response=response).process()
      File "/opt/homebrew/Caskroom/miniconda/base/envs/tg_bot/lib/python3.10/site-packages/homeassistant_api/processing.py", line 82, in process
        raise EndpointNotFoundError(self.response.url)
    homeassistant_api.errors.EndpointNotFoundError: Cannot make request to the endpoint 'https://somemy.domain.com/api/sensor.temperature'
    

    Reason urljoin works not like path join: urljoin('xyz', 'abc') - > 'abc' urljoin('xyz/', 'abc') - > 'xyz/abc'

    bug 
    opened by kizill 7
  • Check for actual http response codes

    Check for actual http response codes

    Currently the wrapper always assumes the request was succesfull (ie. 20x statuscodes), and tries to decode the resulting json. It would be nice if the api client would actually check for the error codes and throws a custom exception when this is not the case.

    I experience this issue when retrieving state for a non existing entity. HA rest api returns a 404 (not found) in this case, which is logical but this is not handled by the API wrapper. It tries to decode the json in a State object resulting in the following error:

      File "/usr/local/lib/python3.9/site-packages/homeassistant_api/models/states.py", line 11, in __init__
        raise ParameterMissingError('"entity_id" attribute is a required parameter')
    homeassistant_api.errors.ParameterMissingError: "entity_id" attribute is a required parameter
    

    Would be nice if a EntityNotFoundError was raised or something similar.

    Currently I have no way to handle this cases cleanly.

    enhancement 
    opened by bramstroker 7
  • Client.get_domain() doesn't return before eating 4+ GB of RAM

    Client.get_domain() doesn't return before eating 4+ GB of RAM

    Describe the bug Running Client.get_domain() pins a core on my laptop to 100% and starts eating RAM. I had to Ctrl-C to get it to stop.

    To Reproduce

    import os
    import logging
    
    logging.basicConfig(level=logging.DEBUG)
    
    from homeassistant_api import Client as HASSClient
    
    HASS_SERVER = os.getenv("HASS_SERVER")
    HASS_TOKEN = os.getenv("HASS_TOKEN")
    
    client = HASSClient(f"{HASS_SERVER}/api", HASS_TOKEN)
    
    client.check_api_running()
    
    lights = client.get_domain("light")     
    

    Expected behavior I expect some object with all of my lights in it.

    Screenshots

    $ python                                                                                     
    Python 3.10.4 (main, Mar 25 2022, 00:00:00) [GCC 11.2.1 20220127 (Red Hat 11.2.1-9)] on linux                         
    Type "help", "copyright", "credits" or "license" for more information.                                                
    >>> import os                                                                                                         
    >>> import logging                                                                                                     
    >>>                                                                                                                   
    >>> logging.basicConfig(level=logging.DEBUG)                                                                           
    >>>                                                                                                                   
    >>> from homeassistant_api import Client as HASSClient                                                                 
    >>>                                                                                                                   
    >>> HASS_SERVER = os.getenv("HASS_SERVER")                                                                             
    >>> HASS_TOKEN = os.getenv("HASS_TOKEN")                                                                              
    >>>                                                                                                                    
    >>> client = HASSClient(f"{HASS_SERVER}/api", HASS_TOKEN)                                                             
    >>>                                                                                                                    
    >>> client.check_api_running()                                                                                        
    DEBUG:homeassistant_api.rawclient:GET request to http://homeassistant.local:8123/api/                                  
    DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): homeassistant.local:8123                                
    DEBUG:urllib3.connectionpool:http://homeassistant.local:8123 "GET /api/ HTTP/1.1" 200 35                               
    DEBUG:homeassistant_api.processing:Using processor <function process_json at 0x7f5d1f028ee0> on <Response [200]>       
    True                                                       
    >>> lights = client.get_domain("light")
    DEBUG:homeassistant_api.rawclient:GET request to http://homeassistant.local:8123/api/services                          
    DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): homeassistant.local:8123                                
    DEBUG:urllib3.connectionpool:http://homeassistant.local:8123 "GET /api/services HTTP/1.1" 200 17322                    
    DEBUG:homeassistant_api.processing:Using processor <function process_json at 0x7f5d1f028ee0> on <Response [200]>       
    ^CTraceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/tmp/venv/lib/python3.10/site-packages/homeassistant_api/rawclient.py", line 213, in get_domain                
        domains = self.get_domains()
      File "/tmp/venv/lib/python3.10/site-packages/homeassistant_api/rawclient.py", line 209, in get_domains               
        return tuple(services)                                 
      File "/tmp/venv/lib/python3.10/site-packages/homeassistant_api/mixins.py", line 18, in process_services_json         
        domain.add_service(service_id, **data)
      File "/tmp/venv/lib/python3.10/site-packages/homeassistant_api/models/domains.py", line 24, in add_service           
        service_id: Service(                                   
      File "pydantic/main.py", line 339, in pydantic.main.BaseModel.__init__                                               
      File "pydantic/main.py", line 1038, in pydantic.main.validate_model                                                  
      File "pydantic/fields.py", line 857, in pydantic.fields.ModelField.validate                                          
      File "pydantic/fields.py", line 1074, in pydantic.fields.ModelField._validate_singleton                              
      File "pydantic/fields.py", line 1121, in pydantic.fields.ModelField._apply_validators                                
      File "pydantic/class_validators.py", line 313, in pydantic.class_validators._generic_validator_basic.lambda12        
      File "pydantic/main.py", line 679, in pydantic.main.BaseModel.validate                                               
      File "pydantic/main.py", line 605, in pydantic.main.BaseModel._copy_and_set_values                                   
      File "/usr/lib64/python3.10/copy.py", line 146, in deepcopy                                                          
        y = copier(x, memo)                                    
      File "/usr/lib64/python3.10/copy.py", line 231, in _deepcopy_dict                                                    
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "/usr/lib64/python3.10/copy.py", line 146, in deepcopy
        y = copier(x, memo)                                    
      File "/usr/lib64/python3.10/copy.py", line 231, in _deepcopy_dict                                                    
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "/usr/lib64/python3.10/copy.py", line 172, in deepcopy                                                          
        y = _reconstruct(x, memo, *rv)
      File "/usr/lib64/python3.10/copy.py", line 271, in _reconstruct                                                      
        state = deepcopy(state, memo)
      File "/usr/lib64/python3.10/copy.py", line 146, in deepcopy                                                          
        y = copier(x, memo)                                    
      File "/usr/lib64/python3.10/copy.py", line 231, in _deepcopy_dict                                                    
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "/usr/lib64/python3.10/copy.py", line 146, in deepcopy                                                          
        y = copier(x, memo)                                    
      File "/usr/lib64/python3.10/copy.py", line 231, in _deepcopy_dict                                                    
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "/usr/lib64/python3.10/copy.py", line 172, in deepcopy                                                          
        y = _reconstruct(x, memo, *rv)
      File "/usr/lib64/python3.10/copy.py", line 271, in _reconstruct                                                      
        state = deepcopy(state, memo)
      File "/usr/lib64/python3.10/copy.py", line 146, in deepcopy                                                          
        y = copier(x, memo)                                    
      File "/usr/lib64/python3.10/copy.py", line 231, in _deepcopy_dict                                                    
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "/usr/lib64/python3.10/copy.py", line 146, in deepcopy                                                          
        y = copier(x, memo)                                    
      File "/usr/lib64/python3.10/copy.py", line 231, in _deepcopy_dict                                                    
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "/usr/lib64/python3.10/copy.py", line 146, in deepcopy                                                          
        y = copier(x, memo)                                    
      File "/usr/lib64/python3.10/copy.py", line 231, in _deepcopy_dict                                                    
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "/usr/lib64/python3.10/copy.py", line 172, in deepcopy                                                          
        y = _reconstruct(x, memo, *rv)
      File "/usr/lib64/python3.10/copy.py", line 271, in _reconstruct                                                      
        state = deepcopy(state, memo)
      File "/usr/lib64/python3.10/copy.py", line 146, in deepcopy                                                          
        y = copier(x, memo)                                    
      File "/usr/lib64/python3.10/copy.py", line 231, in _deepcopy_dict                                                    
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "/usr/lib64/python3.10/copy.py", line 146, in deepcopy                                                          
        y = copier(x, memo)                                    
      File "/usr/lib64/python3.10/copy.py", line 231, in _deepcopy_dict                                                    
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "/usr/lib64/python3.10/copy.py", line 172, in deepcopy                                                          
        y = _reconstruct(x, memo, *rv)
      File "/usr/lib64/python3.10/copy.py", line 271, in _reconstruct                                                      
        state = deepcopy(state, memo)
      File "/usr/lib64/python3.10/copy.py", line 146, in deepcopy                                                          
        y = copier(x, memo)
      File "/usr/lib64/python3.10/copy.py", line 231, in _deepcopy_dict
        y[deepcopy(key, memo)] = deepcopy(value, memo)
      File "/usr/lib64/python3.10/copy.py", line 172, in deepcopy
        y = _reconstruct(x, memo, *rv)
      File "/usr/lib64/python3.10/copy.py", line 273, in _reconstruct
        y.__setstate__(state)
    KeyboardInterrupt
    >>>
    

    Desktop (please complete the following information):

    • OS: Fedora
    • OS Version: 35
    • Python version: 3.10.4
    • pip freeze:
    aiodns==3.0.0
    aiohttp==3.8.1
    aiohttp-client-cache==0.6.1
    aiosignal==1.2.0
    appdirs==1.4.4
    async-timeout==4.0.2
    attrs==21.4.0
    Brotli==1.0.9
    cattrs==1.10.0
    cchardet==2.1.7
    certifi==2022.6.15
    cffi==1.15.0
    charset-normalizer==2.0.12
    frozenlist==1.3.0
    homeassistant-api==3.0.3.post5
    idna==3.3
    itsdangerous==2.1.2
    multidict==6.0.2
    pycares==4.1.2
    pycparser==2.21
    pydantic==1.9.1
    python-forge==18.6.0
    requests==2.28.0
    requests-cache==0.9.4
    simplejson==3.17.6
    six==1.16.0
    typing_extensions==4.2.0
    url-normalize==1.4.3
    urllib3==1.26.9
    yarl==1.7.2
    

    Home Assistant Versions:

    • Home Assistant Core 2022.6.6
    • Home Assistant Supervisor 2022.05.3
    • Home Assistant OS 8.2
    bug 
    opened by kdknigga 6
  • Better history functions & fix bug with sync add_entity call

    Better history functions & fix bug with sync add_entity call

    I'm trying to play with history functions and have found that *args & **kwargs are not the best friends of mine :) Also fixed small bug with add_entity call.

    opened by kizill 6
  • [Library Bug] measurement stopped with error after 3 minutes

    [Library Bug] measurement stopped with error after 3 minutes

    Describe the bug I started measurement, everything was fine and suddenly after 3 minutes it stopped. all devices still available on the network, no outage that I am aware of.

    2022-02-14 09:17:08,748 [INFO] Selected Light controller: hass
    ? Select the color mode?  color_temp
    ? Do you want to generate model.json?  Yes
    ? Specify the full light model name  Yeelight YLDP02YL 600lm 1700K-6500K WiFi RGB Bulb
    ? Which powermeter (manufacturer, model) do you use to take the measurement?  Gosund SP111 v1.1
    ? Do you want to gzip CSV files?  Yes
    ? Are you measuring multiple lights. In some situations it helps to connect multiple lights to be able to measure low currents.  No
    ? Select the light?  light.yeelight
    ? What model is your light? Ex: LED1837R5  YLDP02YL
    2022-02-14 09:17:48,190 [INFO] Measuring standby power. Waiting for 20 seconds...
    2022-02-14 09:18:09,386 [INFO] Start taking measurements for color mode: color_temp
    2022-02-14 09:18:09,387 [INFO] Waiting 10 seconds...
    2022-02-14 09:18:19,398 [INFO] Changing light to: ColorTempVariation(bri=1, ct=153)
    2022-02-14 09:18:22,502 [INFO] Measured power: 2.1
    2022-02-14 09:18:22,503 [INFO] Changing light to: ColorTempVariation(bri=1, ct=163)
    2022-02-14 09:18:25,589 [INFO] Measured power: 2.5
    2022-02-14 09:18:25,590 [INFO] Changing light to: ColorTempVariation(bri=1, ct=173)
    2022-02-14 09:18:28,727 [INFO] Measured power: 1.8
    2022-02-14 09:18:28,727 [INFO] Changing light to: ColorTempVariation(bri=1, ct=183)
    2022-02-14 09:18:31,907 [INFO] Measured power: 1.7
    2022-02-14 09:18:31,908 [INFO] Changing light to: ColorTempVariation(bri=1, ct=193)
    2022-02-14 09:18:35,039 [INFO] Measured power: 1.8
    2022-02-14 09:18:35,039 [INFO] Changing light to: ColorTempVariation(bri=1, ct=203)
    2022-02-14 09:18:38,135 [INFO] Measured power: 1.7
    2022-02-14 09:18:38,136 [INFO] Changing light to: ColorTempVariation(bri=1, ct=213)
    2022-02-14 09:18:41,231 [INFO] Measured power: 2.1
    2022-02-14 09:18:41,231 [INFO] Changing light to: ColorTempVariation(bri=1, ct=223)
    2022-02-14 09:18:44,368 [INFO] Measured power: 2.2
    2022-02-14 09:18:44,369 [INFO] Changing light to: ColorTempVariation(bri=1, ct=233)
    2022-02-14 09:18:47,448 [INFO] Measured power: 1.7
    2022-02-14 09:18:47,449 [INFO] Changing light to: ColorTempVariation(bri=1, ct=243)
    2022-02-14 09:18:50,631 [INFO] Measured power: 1.9
    2022-02-14 09:18:50,632 [INFO] Changing light to: ColorTempVariation(bri=1, ct=253)
    2022-02-14 09:18:53,776 [INFO] Measured power: 2.1
    2022-02-14 09:18:53,777 [INFO] Changing light to: ColorTempVariation(bri=1, ct=263)
    2022-02-14 09:18:56,967 [INFO] Measured power: 1.9
    2022-02-14 09:18:56,968 [INFO] Changing light to: ColorTempVariation(bri=1, ct=273)
    2022-02-14 09:19:00,161 [INFO] Measured power: 1.9
    2022-02-14 09:19:00,162 [INFO] Changing light to: ColorTempVariation(bri=1, ct=283)
    2022-02-14 09:19:03,239 [INFO] Measured power: 1.8
    2022-02-14 09:19:03,240 [INFO] Changing light to: ColorTempVariation(bri=1, ct=293)
    2022-02-14 09:19:06,320 [INFO] Measured power: 1.9
    2022-02-14 09:19:06,321 [INFO] Changing light to: ColorTempVariation(bri=1, ct=303)
    2022-02-14 09:19:09,492 [INFO] Measured power: 2.0
    2022-02-14 09:19:09,492 [INFO] Changing light to: ColorTempVariation(bri=1, ct=313)
    2022-02-14 09:19:12,567 [INFO] Measured power: 2.1
    2022-02-14 09:19:12,568 [INFO] Changing light to: ColorTempVariation(bri=1, ct=323)
    2022-02-14 09:19:15,637 [INFO] Measured power: 2.0
    2022-02-14 09:19:15,638 [INFO] Changing light to: ColorTempVariation(bri=1, ct=333)
    2022-02-14 09:19:18,712 [INFO] Measured power: 2.0
    2022-02-14 09:19:18,713 [INFO] Changing light to: ColorTempVariation(bri=1, ct=343)
    2022-02-14 09:19:21,843 [INFO] Measured power: 1.7
    2022-02-14 09:19:21,844 [INFO] Changing light to: ColorTempVariation(bri=1, ct=353)
    2022-02-14 09:19:24,916 [INFO] Measured power: 1.8
    2022-02-14 09:19:24,917 [INFO] Changing light to: ColorTempVariation(bri=1, ct=363)
    2022-02-14 09:19:27,994 [INFO] Measured power: 1.8
    2022-02-14 09:19:27,995 [INFO] Changing light to: ColorTempVariation(bri=1, ct=373)
    2022-02-14 09:19:31,071 [INFO] Measured power: 1.9
    2022-02-14 09:19:31,072 [INFO] Changing light to: ColorTempVariation(bri=1, ct=383)
    2022-02-14 09:19:34,147 [INFO] Measured power: 1.9
    2022-02-14 09:19:34,148 [INFO] Changing light to: ColorTempVariation(bri=1, ct=393)
    2022-02-14 09:19:37,335 [INFO] Measured power: 1.7
    2022-02-14 09:19:37,336 [INFO] Changing light to: ColorTempVariation(bri=1, ct=403)
    2022-02-14 09:19:40,428 [INFO] Measured power: 1.6
    2022-02-14 09:19:40,428 [INFO] Changing light to: ColorTempVariation(bri=1, ct=413)
    2022-02-14 09:19:43,505 [INFO] Measured power: 1.7
    2022-02-14 09:19:43,506 [INFO] Changing light to: ColorTempVariation(bri=1, ct=423)
    2022-02-14 09:19:46,589 [INFO] Measured power: 1.5
    2022-02-14 09:19:46,590 [INFO] Changing light to: ColorTempVariation(bri=1, ct=433)
    2022-02-14 09:19:49,722 [INFO] Measured power: 1.5
    2022-02-14 09:19:49,723 [INFO] Changing light to: ColorTempVariation(bri=1, ct=443)
    2022-02-14 09:19:52,833 [INFO] Measured power: 1.6
    2022-02-14 09:19:52,834 [INFO] Changing light to: ColorTempVariation(bri=1, ct=453)
    2022-02-14 09:19:55,975 [INFO] Measured power: 2.2
    2022-02-14 09:19:55,976 [INFO] Changing light to: ColorTempVariation(bri=1, ct=463)
    2022-02-14 09:19:59,091 [INFO] Measured power: 1.7
    2022-02-14 09:19:59,092 [INFO] Changing light to: ColorTempVariation(bri=1, ct=473)
    2022-02-14 09:20:02,178 [INFO] Measured power: 1.5
    2022-02-14 09:20:02,179 [INFO] Changing light to: ColorTempVariation(bri=1, ct=483)
    2022-02-14 09:20:05,286 [INFO] Measured power: 1.7
    2022-02-14 09:20:05,287 [INFO] Changing light to: ColorTempVariation(bri=1, ct=493)
    2022-02-14 09:20:08,435 [INFO] Measured power: 1.7
    2022-02-14 09:20:08,436 [INFO] Changing light to: ColorTempVariation(bri=1, ct=503)
    2022-02-14 09:20:11,522 [INFO] Measured power: 1.4
    2022-02-14 09:20:11,522 [INFO] Changing light to: ColorTempVariation(bri=1, ct=513)
    2022-02-14 09:20:14,651 [INFO] Measured power: 2.0
    2022-02-14 09:20:14,652 [INFO] Changing light to: ColorTempVariation(bri=1, ct=523)
    2022-02-14 09:20:17,794 [INFO] Measured power: 1.5
    2022-02-14 09:20:17,794 [INFO] Changing light to: ColorTempVariation(bri=1, ct=533)
    2022-02-14 09:20:20,963 [INFO] Measured power: 1.5
    2022-02-14 09:20:20,964 [INFO] Changing light to: ColorTempVariation(bri=1, ct=543)
    2022-02-14 09:20:24,104 [INFO] Measured power: 1.6
    2022-02-14 09:20:24,104 [INFO] Changing light to: ColorTempVariation(bri=1, ct=553)
    2022-02-14 09:20:27,182 [INFO] Measured power: 1.5
    2022-02-14 09:20:27,183 [INFO] Changing light to: ColorTempVariation(bri=1, ct=563)
    2022-02-14 09:20:30,285 [INFO] Measured power: 2.0
    2022-02-14 09:20:30,286 [INFO] Changing light to: ColorTempVariation(bri=1, ct=573)
    2022-02-14 09:20:33,396 [INFO] Measured power: 2.0
    2022-02-14 09:20:33,397 [INFO] Changing light to: ColorTempVariation(bri=1, ct=583)
    2022-02-14 09:20:36,530 [INFO] Measured power: 1.9
    2022-02-14 09:20:36,530 [INFO] Changing light to: ColorTempVariation(bri=1, ct=588)
    2022-02-14 09:20:39,595 [INFO] Measured power: 1.8
    2022-02-14 09:20:39,596 [INFO] Changing light to: ColorTempVariation(bri=6, ct=153)
    2022-02-14 09:20:39,640 [INFO] Extra waiting for significant CT change...
    2022-02-14 09:20:52,805 [INFO] Measured power: 2.1
    2022-02-14 09:20:52,806 [INFO] Changing light to: ColorTempVariation(bri=6, ct=163)
    2022-02-14 09:20:55,880 [INFO] Measured power: 2.0
    2022-02-14 09:20:55,881 [INFO] Changing light to: ColorTempVariation(bri=6, ct=173)
    2022-02-14 09:20:59,137 [INFO] Measured power: 1.9
    2022-02-14 09:20:59,137 [INFO] Changing light to: ColorTempVariation(bri=6, ct=183)
    2022-02-14 09:21:02,306 [INFO] Measured power: 2.6
    2022-02-14 09:21:02,306 [INFO] Changing light to: ColorTempVariation(bri=6, ct=193)
    2022-02-14 09:21:05,423 [INFO] Measured power: 2.3
    2022-02-14 09:21:05,424 [INFO] Changing light to: ColorTempVariation(bri=6, ct=203)
    If this happened, please report it at https://github.com/GrandMoff100/HomeAssistantAPI/issues with the request status code and the request content
    Traceback (most recent call last):
      File "measure.py", line 544, in <module>
        main()
      File "measure.py", line 541, in main
        measure.start()
      File "measure.py", line 186, in start
        self.light_controller.change_light_state(
      File "/app/light_controller/hass.py", line 31, in change_light_state
        self.client.trigger_service('light', 'turn_on', **json)
      File "/usr/local/lib/python3.8/site-packages/homeassistant_api/client.py", line 185, in trigger_service
        data = self.request(
      File "/usr/local/lib/python3.8/site-packages/homeassistant_api/rawapi.py", line 59, in request
        return self.response_logic(resp)
      File "/usr/local/lib/python3.8/site-packages/homeassistant_api/rawapi.py", line 64, in response_logic
        return processing.process()
      File "/usr/local/lib/python3.8/site-packages/homeassistant_api/processing.py", line 73, in process
        raise UnexpectedStatusCodeError(self.response.status_code, self.response.content)
    homeassistant_api.errors.UnexpectedStatusCodeError: Homeassistant return response with an unrecognized status code 500.
    b'500 Internal Server Error\n\nServer got itself in trouble'
    

    To Reproduce Steps to reproduce the behavior:

    1. Start measure
    2. Wait about 3 minutes of correct behavior
    3. See error

    Expected behavior I'd like to be able to finish the measurement so I can provide new bulb models into repository.

    Screenshots temp_screen

    Desktop (please complete the following information):

    • OS: Debian
    • OS Version: 11 (bullseye)
    • HomeAssistantAPI Version: can't find API version, but: HomeAssistant core-2022.2.6, supervisor-2022.01.1

    Additional context I've tried hs & color_temp modes - both with the same error.

    bug invalid 
    opened by pejotigrek 6
  • 'Service' object is not callable

    'Service' object is not callable

    Describe the bug Attempting to call a service object throws a 'Service' object is not callable error.

    To Reproduce Steps to reproduce the behavior:

    1. Run the quick example. services.light.turn_on(entity_id='light.living_room_lamp')
    2. See an error

    Expected behavior light.living_room_lamp turns off.

    Desktop (please complete the following information):

    • OS: Ubuntu 21.04
    • HomeAssistantAPI Version: 2.4.0.post2
    bug 
    opened by walking-octopus 4
  • Fix Unclosed Sessions

    Fix Unclosed Sessions

    Due to some tricky super() stuff the init code for RawAsyncClient was getting run for RawClient. By directly calling the parent init we solved this trickiness.

    opened by GrandMoff100 3
  • Function to access entity attributes, such as state

    Function to access entity attributes, such as state

    Was looking for a way to check the state of an entity (e.g. if a switch is 'on' or 'off'), I think adding a function like this would solve it. Another solution could be a function that returns the unprocessed request to /states/{entity_id}.

    opened by gaileyleseman 3
  • Error in test script

    Error in test script

    Hi, get this error when trying your example code, any idea? Do you have any additional documentation for this library?

    C:\PythonApps\home_ass>python wrapper_test.py
    Traceback (most recent call last):
      File "C:\PythonApps\home_ass\wrapper_test.py", line 11, in <module>
        client = Client(url, token)
      File "C:\Users\Hugo\AppData\Local\Programs\Python\Python39\lib\site-packages\homeassistant_api\rawclient.py", line 58, in __init__
        self.check_api_config()
      File "C:\Users\Hugo\AppData\Local\Programs\Python\Python39\lib\site-packages\homeassistant_api\rawclient.py", line 80, in check_api_config
        valid = {'valid': True, 'invalid': False}.get(res['result'], None)
    TypeError: string indices must be integers
    
    documentation 
    opened by huggre 3
  • Allow returning raw bytes from a request, without attempting to decode.

    Allow returning raw bytes from a request, without attempting to decode.

    Some API calls can return binary data, e.g. fetching a user's profile image (e.g. api path like /api/image/serve/<hash>/512x512).

    Currently this library attempts to decode all responses from bytes to str using the default utf-8 encoding, which fails for API calls returning binary data since the first byte of e.g. JPEG data (0xFF) can't be decoded to text.

    This PR adds a by-default-no-change-to-external-behaviour flag to the RawClient.request method to optionally disable decoding for that request, just returning the raw bytes.

    opened by hnefatl 2
  • Bump certifi from 2022.9.24 to 2022.12.7

    Bump certifi from 2022.9.24 to 2022.12.7

    Bumps certifi from 2022.9.24 to 2022.12.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
Releases(v4.0.1)
  • v4.0.1(Dec 3, 2022)

    What's Changed

    • Fix case where parent frame is global namespace by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/119
    • Make ServiceField's description an Optional[str] by @Azimath in https://github.com/GrandMoff100/HomeAssistantAPI/pull/121
    • Remove cron testing trigger by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/122
    • Call RawClient.__init__ in sync contexts and RawAsyncClient.__init__ in async contexts. by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/125
    • Fix readthedocs builds by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/131
    • Loosen up requests library version by @daniele-athome in https://github.com/GrandMoff100/HomeAssistantAPI/pull/130
    • Increase context character limit to 128 by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/129
    • Update workflows by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/132
    • Fix Unclosed Sessions by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/133

    New Contributors

    • @Azimath made their first contribution in https://github.com/GrandMoff100/HomeAssistantAPI/pull/121
    • @daniele-athome made their first contribution in https://github.com/GrandMoff100/HomeAssistantAPI/pull/130

    Full Changelog: https://github.com/GrandMoff100/HomeAssistantAPI/compare/v4.0.0...v4.0.1

    Source code(tar.gz)
    Source code(zip)
  • v4.0.0.post2(Aug 24, 2022)

    What's Changed

    • Make ServiceField's description an Optional[str] by @Azimath in https://github.com/GrandMoff100/HomeAssistantAPI/pull/121
    • Remove cron testing trigger by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/122
    • Call RawClient.__init__ in sync contexts and RawAsyncClient.__init__ in async contexts. by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/125

    New Contributors

    • @Azimath made their first contribution in https://github.com/GrandMoff100/HomeAssistantAPI/pull/121

    Full Changelog: https://github.com/GrandMoff100/HomeAssistantAPI/compare/v4.0.0.post1...v4.0.0.post2

    Source code(tar.gz)
    Source code(zip)
  • v4.0.0.post1(Jul 30, 2022)

    What's Changed

    • Fix case where parent frame is global namespace by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/119

    Full Changelog: https://github.com/GrandMoff100/HomeAssistantAPI/compare/v4.0.0...v4.0.0.post1

    Source code(tar.gz)
    Source code(zip)
  • v4.0.0(Jul 3, 2022)

    What's Changed

    • Add CODE_OF_CONDUCT.md by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/108
    • Added Automatic Testing Server and Test Suite by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/112
    • Added Refresh Tokens to the Authentication section of the docs. by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/114
    • Integrate coverage reports by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/116

    Lots of stuff has changed in this release. Be aware that this is a non-backwards compatible release. Docs have been polished up. Project structure has been reorganized. And lots of tools to help manage the codebase quality have been added!

    Full Changelog: https://github.com/GrandMoff100/HomeAssistantAPI/compare/v3.0.4...v4.0.0

    Source code(tar.gz)
    Source code(zip)
  • v3.0.4(Jun 20, 2022)

    What's Changed

    • Moved autodoc-pydantic to dev dependency by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/90
    • Fixed API reference methods not showing reference links by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/87
    • Replace d.get(k, None) calls with d.get(k) by @bswck in https://github.com/GrandMoff100/HomeAssistantAPI/pull/91
    • Emit unexpected status code warning to stderr by @bswck in https://github.com/GrandMoff100/HomeAssistantAPI/pull/92
    • Fixed key issue and post version type issues. by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/95
    • Replaced os.path.join with urllib.parse.urljoin by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/97
    • Replaced os.path.join with urljoin in rawclient.py by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/99
    • Added requests and session debug logging by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/100
    • Explicitly use posixpath.join to join urls by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/102
    • Fix end_timestamp format - url quoting needed by @kizill in https://github.com/GrandMoff100/HomeAssistantAPI/pull/104
    • Better history functions & fix bug with sync add_entity call by @kizill in https://github.com/GrandMoff100/HomeAssistantAPI/pull/103
    • Reverted pydantic to 1.9.0 and removed super contained objects from representation in Service models by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/106

    New Contributors

    • @bswck made their first contribution in https://github.com/GrandMoff100/HomeAssistantAPI/pull/91
    • @kizill made their first contribution in https://github.com/GrandMoff100/HomeAssistantAPI/pull/104

    Full Changelog: https://github.com/GrandMoff100/HomeAssistantAPI/compare/v3.0.3...v3.0.4

    Source code(tar.gz)
    Source code(zip)
  • v3.0.3.post5(Jun 16, 2022)

    What's Changed

    • Fix end_timestamp format - url quoting needed by @kizill in https://github.com/GrandMoff100/HomeAssistantAPI/pull/104
    • Better history functions & fix bug with sync add_entity call by @kizill in https://github.com/GrandMoff100/HomeAssistantAPI/pull/103

    New Contributors

    • @kizill made their first contribution in https://github.com/GrandMoff100/HomeAssistantAPI/pull/104

    Full Changelog: https://github.com/GrandMoff100/HomeAssistantAPI/compare/v3.0.3.post4...v3.0.3.post5

    Source code(tar.gz)
    Source code(zip)
  • v3.0.3.post4(Jun 13, 2022)

    What's Changed

    • Explicitly use posixpath.join to join urls by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/102

    Full Changelog: https://github.com/GrandMoff100/HomeAssistantAPI/compare/v3.0.3.post3...v3.0.3.post4

    Source code(tar.gz)
    Source code(zip)
  • v3.0.3.post3(May 29, 2022)

    What's Changed

    • Replaced os.path.join with urljoin in rawclient.py by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/99
    • Added requests and session debug logging by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/100

    Full Changelog: https://github.com/GrandMoff100/HomeAssistantAPI/compare/v3.0.3.post2...v3.0.3.post3

    Source code(tar.gz)
    Source code(zip)
  • v3.0.3.post2(Apr 7, 2022)

    What's Changed

    • Replace d.get(k, None) calls with d.get(k) by @bswck in https://github.com/GrandMoff100/HomeAssistantAPI/pull/91
    • Emit unexpected status code warning to stderr by @bswck in https://github.com/GrandMoff100/HomeAssistantAPI/pull/92
    • Fixed key issue and post version type issues. by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/95
    • Replaced os.path.join with urllib.parse.urljoin by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/97

    New Contributors

    • @bswck made their first contribution in https://github.com/GrandMoff100/HomeAssistantAPI/pull/91

    Full Changelog: https://github.com/GrandMoff100/HomeAssistantAPI/compare/v3.0.3.post1...v3.0.3.post2

    Source code(tar.gz)
    Source code(zip)
  • v3.0.3.post1(Mar 17, 2022)

    What's Changed

    • Moved autodoc-pydantic to dev dependency by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/90

    Full Changelog: https://github.com/GrandMoff100/HomeAssistantAPI/compare/v3.0.3...v3.0.3.post1

    Source code(tar.gz)
    Source code(zip)
  • v3.0.3(Mar 6, 2022)

    What's Changed

    • Added Pydantic Model Autodocs by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/77
    • Replaced explicit malformed_id with implicit format_entity_id by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/78
    • Fixed docs cross-references. by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/79
    • Autolabel documentation sections by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/80
    • Added Persistent Caching to Advanced Section by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/81
    • Fixed missing py.typed marker #83 by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/85
    • Bump mypy to 0.931 by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/84

    Full Changelog: https://github.com/GrandMoff100/HomeAssistantAPI/compare/v3.0.2...v3.0.3

    Source code(tar.gz)
    Source code(zip)
  • v3.0.2(Mar 1, 2022)

    What's Changed

    • Exclude model client attribute for export and repr by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/65
    • Added LogbookEntry model by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/67
    • Merge developer for docs. by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/70
    • Merge new docs by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/72
    • Bug fixes by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/75

    Full Changelog: https://github.com/GrandMoff100/HomeAssistantAPI/compare/v3.0.0...v3.0.2

    Source code(tar.gz)
    Source code(zip)
  • v3.0.0(Feb 22, 2022)

    What's Changed

    • Post Version Fixes by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/42
    • Fixed autodoc import error from base package by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/43
    • Buff docs styling by @FoxNerdSaysMoo in https://github.com/GrandMoff100/HomeAssistantAPI/pull/44
    • Buff docs further, fix duplicated toctree, fix sphinx build warnings by @FoxNerdSaysMoo in https://github.com/GrandMoff100/HomeAssistantAPI/pull/46
    • Add pre-commit standard by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/51
    • Modernized codebase. by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/54
    • Integrate Megalinter (alpha) by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/56
    • Merge Pydantic Models by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/58
    • Fixed some model bugs and duplicate code by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/59
    • Implement request caching. by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/60
    • Merge docs for new version! by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/63

    Full Changelog: https://github.com/GrandMoff100/HomeAssistantAPI/compare/v2.4.0...v3.0.0

    Source code(tar.gz)
    Source code(zip)
  • v2.4.0-post2(Nov 5, 2021)

    What's Changed

    • Fixed autodoc import error from base package by @GrandMoff100 in https://github.com/GrandMoff100/HomeAssistantAPI/pull/43
    • Buff docs styling by @FoxNerdSaysMoo in https://github.com/GrandMoff100/HomeAssistantAPI/pull/44
    • Buff docs further, fix duplicated toctree, fix sphinx build warnings by @FoxNerdSaysMoo in
    • Fixed that darn malformed_id function in homeassistant_api/client.py by @bramstroker
    • https://github.com/GrandMoff100/HomeAssistantAPI/pull/46

    As always, let me know what cool projects you're working on with this!

    Full Changelog: https://github.com/GrandMoff100/HomeAssistantAPI/compare/v2.4.0...v2.4.0-post2

    Source code(tar.gz)
    Source code(zip)
  • v2.4.0-post1(Oct 15, 2021)

  • v2.4.0(Oct 14, 2021)

    This release is pretty small but fixed some key issues.

    1. It now checks the HTTP status code of the response and raises exceptions accordingly.
    2. Response content exceptions are now raised in the Processing class where they make sense to be raised.
    3. Users can add their own processors to extend the library if Homeassistant returns different Content-Type headers such as binary files like images.
    4. AsyncClient methods worked inconsistently because of a few bugs that are now resolved and AsyncClient methods work smoothly now.

    Enjoy! Read the new Response Processing docs here

    Source code(tar.gz)
    Source code(zip)
  • v2.3.0(Sep 19, 2021)

    Fixed a few user raised bugs and issues and added a global request parameter kwargs to Client initialization. Keyword arguments like timeout get passed to requests.request and aiohttp.ClientSession.request to customized client interaction even more. Go show us what you can make! Open a discussion! And most of all have fun!

    Source code(tar.gz)
    Source code(zip)
  • v2.2.0(Jul 23, 2021)

    This release now includes an AsyncClient as promised. As well as Async Data Models. The associated documentation is now also there as well. As always, go make some cools stuff and share it with us! Have fun!

    Source code(tar.gz)
    Source code(zip)
  • v2.1.0(Jul 21, 2021)

  • v2.0.0(Jul 15, 2021)

  • v2.0.0rc(Jul 15, 2021)

    Finally! Documentation using sphinx is now added so all of us can read how the code works and how to use it now! Woohoo! Multiple requested features were added in the last pre-release such as entity state setting. I think we've almost reached a milestone and now all left to do is clean up some files and make minor adjustments in preparation for the official release! Enjoy!

    Source code(tar.gz)
    Source code(zip)
  • v2.0.0a1(Jul 13, 2021)

    This release has rewritten the processing of json data from the api to accommodate data model classes and data mode methods. It has about 90% of the features I planned on adding. I'm going to be busy the next few days. So the rest of the features, examples and documentation readthedocs site won't be started until then. But this version is released on Pypi so if you're brave or curious enough to figure out the new features yourself from the example.py upgrade to the this version with pip. pip install homeassistant_api==2.0.0a1 and enjoy! Otherwise sit tight and a couple more pre-releases and we'll have a full-fledged version! Thank you for your continued interest and time in this project. As always have fun and do cool stuff.

    Source code(tar.gz)
    Source code(zip)
    HomeAssistant.API-2.0.0a1.tar.gz.tar(6.20 KB)
Owner
Nate
Expert Python Developer. I specialize in frontend web-development and library development in python. I enjoy contributing to and designing open-source projects.
Nate
An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and display it on a FeatherS2 in an OLED display.

CircuitPython IoT Trivia ESP32-S2 OLED Version An IoT Trivia app that shows you how to take a JSON web API such as the opentdb.com API and stream and

Kevin Thomas 1 Nov 27, 2021
GUI wrapper designed for convenient service work with TI CC1352/CC2538/CC2652 based Zigbee sticks or gateways. Packed into single executable file

ZigStar GW Multi tool is GUI wrapper firtsly designed for convenient service work with Zig Star LAN GW, but now supports any TI CC1352/CC2538/CC2652 b

null 133 Jan 1, 2023
Detic ros - A simple ROS wrapper for Detic instance segmentation using pre-trained dataset

Detic ros - A simple ROS wrapper for Detic instance segmentation using pre-trained dataset

Hirokazu Ishida 12 Nov 19, 2022
Pylorawan is a Micropython wrapper for lorawan devices from RAK Wireless.

pylorawan Pylorawan is a Micropython wrapper for lorawan devices from RAK Wireless. Tested on a Raspberry PI Pico with a RAK4200(H) Evaluation Board (

Peter Houghton 3 Nov 4, 2022
A python file which I wrote to allow the Dorna Robots API to draw an Image on a 3D plane

Dorna-Robotics-Internship Code In the directory "Code" is a python file which I wrote to allow the Dorna Robots API to draw an Image on a 3D plane. I

Stephen Otto 2 Dec 6, 2021
Provide Unifi device info via api to Home Assistant that will give ap sensors

Unifi AP Device info Provide Unifi device info via api to Home Assistant that will give ap sensors

null 12 Jan 7, 2023
Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API.

Hildebrand Glow (DCC) Integration Home Assistant integration for energy consumption data from UK SMETS (Smart) meters using the Hildebrand Glow API. T

Aniket 153 Dec 30, 2022
I made this so I can control my Tapo L510 light bulb and Govee H6159 light strip using the PyP100 module and the Govee public API

TAPO-And-Govee-Controller I made this so I can control my Tapo L510 light bulb and Govee H6159 light strip using the PyP100 module and the Govee publi

James Westhead 0 Nov 23, 2021
Using a GNSS module (Beidou + GPS) and the mapquest static map API

Using a GNSS module (Beidou + GPS) and the mapquest static map API

Kongduino 1 Nov 4, 2021
Simple Weather Check base on Hefeng api, Work on raspberry Pi

Simple Weather Check base on Hefeng api, Work on raspberry Pi

Retr0mous 28 Sep 17, 2022
Resmed_myair_sensors - This is a Home Assistant custom component to pull daily CPAP data from ResMed's myAir service using an undocumented API

resmed_myair This component will set up the following platforms. Platform Description sensor Show info from the myAir API. Installation Using the tool

Preston Tamkin 17 Dec 29, 2022
Unofficial Playdate reverse-engineering notes/tools - covers file formats, server API and USB commands

Unofficial Playdate reverse-engineering notes/tools - covers file formats, server API and USB commands ⚠️ This documentation is unofficial and is not

James 106 Dec 31, 2022
Scapy: the Python-based interactive packet manipulation program & library. Supports Python 2 & Python 3.

Scapy Scapy is a powerful Python-based interactive packet manipulation program and library. It is able to forge or decode packets of a wide number of

SecDev 8.3k Jan 8, 2023
Hook and simulate global mouse events in pure Python

mouse Take full control of your mouse with this small Python library. Hook global events, register hotkeys, simulate mouse movement and clicks, and mu

BoppreH 722 Dec 31, 2022
A module for cross-platform control of the mouse and keyboard in python that is simple to install and use.

PyUserInput PyUserInput is a group project so we've moved the project over to a group organization: https://github.com/PyUserInput/PyUserInput . That

Paul Barton 1k Dec 27, 2022
A Python class for controlling the Pimoroni RGB Keypad for Raspberry Pi Pico

rgbkeypad A Python class for controlling the Pimoroni RGB Keypad for the Raspberry Pi Pico. Compatible with MicroPython and CircuitPython. keypad = RG

Martin O'Hanlon 43 Nov 11, 2022
The ABR Control library is a python package for the control and path planning of robotic arms in real or simulated environments.

The ABR Control library is a python package for the control and path planning of robotic arms in real or simulated environments. ABR Control provides API's for the Mujoco, CoppeliaSim (formerly known as VREP), and Pygame simulation environments, and arm configuration files for one, two, and three-joint models, as well as the UR5 and Kinova Jaco 2 arms. Users can also easily extend the package to run with custom arm configurations. ABR Control auto-generates efficient C code for generating the control signals, or uses Mujoco's internal functions to carry out the calculations.

Applied Brain Research 277 Jan 5, 2023
Python Keylogger for Linux

A keylogger is a program that records your keystrokes, this program saves them in a .txt file on your local computer and, after 30 seconds (or as long as you want), it will close the .txt file and send you an email with everything that has been recorded. once the program is run, this cycle will last infinitely if you don't stop it.

Darío Mazzitelli 4 Jul 31, 2021
A Python script to monitor the latest block on an LCD.

PiHole-Monitoring A Python script to monitor the latest block on a lcd display. The first number represents the dns queries from the last 24h, the sec

Maxi 4 Dec 5, 2022