Code Monkey home page Code Monkey logo

rachiopy's Introduction

rachiopy's People

Contributors

allcontributors[bot] avatar bdraco avatar brg468 avatar rfverbruggen avatar rmkraus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rachiopy's Issues

periodic update checks

I really like this api wrapper you have developed. Thank you. I have notifications setup and am notified when a zone turns on or off manually (I haven't tested scheduled events yet). Considering that it is possible that my computer may be turned off and re-started while a zone is running, what is the best way to get the current status of that zone (running or not)?

Use of httplib2 assumes write access to CWD

__init__.py contains:

_HTTP = httplib2.Http('.cache')

This fails if the code is executed from a working directory the user does not have permission to write.

In my specific use case - homeassistant is executing from systemd with a working directory of / and /.cache is not writable.

hass[22572]: Traceback (most recent call last):
hass[22572]: File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
hass[22572]: SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
hass[22572]: File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
hass[22572]: return fut.result()
hass[22572]: File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
hass[22572]: raise self._exception
hass[22572]: File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
hass[22572]: result = self.fn(*self.args, **self.kwargs)
hass[22572]: File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/switch/rachio.py", line 42, in setup_platform
hass[22572]: from rachiopy import Rachio
hass[22572]: File "/srv/homeassistant/lib/python3.4/site-packages/rachiopy/__init__.py", line 14, in <module>
hass[22572]: _HTTP = httplib2.Http('.cache')
hass[22572]: File "/srv/homeassistant/lib/python3.4/site-packages/httplib2/__init__.py", line 915, in __init__
hass[22572]: self.cache = FileCache(cache)
hass[22572]: File "/srv/homeassistant/lib/python3.4/site-packages/httplib2/__init__.py", line 675, in __init__
hass[22572]: os.makedirs(self.cache)
hass[22572]: File "/usr/lib/python3.4/os.py", line 237, in makedirs
hass[22572]: mkdir(name, mode)
hass[22572]: PermissionError: [Errno 13] Permission denied: '.cache'

Please update to consider checking the location prior to calling http2lib AND using a more explicit location like TMPDIR or other.

I got past it for now by just changing .cache to _HTTP = httplib2.Http('/tmp/.rachiopy-cache')

Thanks!

Standby mode not updated

Setting standby mode to On/Off from Lovelace UI is not reflected in Rachio App for iOS. Also, the pop-up window for Standby mode switch does not follow the card.

Fix pypi package

The package doesn't install from pypi because the setup.py has long_description=open('README.md').read() and README.md is not included in the package.

Update Development Status

It's still "Development Status :: 4 - Beta" but should be updated to "Development Status :: 5 - Production/Stable" in the setup.py file.

Outdated docs

getInfo() is outdated and still used as an example.

error generated in r.device.off

r.device.off(id)

TypeError Traceback (most recent call last)
in ()
----> 1 r.device.off(id)

/root/anaconda/lib/python2.7/site-packages/RachioPy-0.1-py2.7.egg/rachiopy/device.pyc in off(self, id)
58 body = { 'id' : id }
59
---> 60 (resp, content) = self.rachio.h.request(url, 'PUT', body=body, header=self.rachio.headers)
61 return content

TypeError: request() got an unexpected keyword argument 'header'

unpredictable behavior

When I write
r.zone.start('2a17314c-30c3-4cae-a6f5-ec79f36d3109',5)
I sometimes get a long delay (30 sec or so), and it returns ''
other times, I get an unhashable type error. It's not predictable which result I will get.

Drop Travis.ci and move to GitHub Actions

Files that should be removed/considered:

  • .travis.yml
  • README.md (badge should be removed)
  • requirements_test.txt (is this still relevant?)
  • tox.ini (is this still relevant? Could be usefull for local testing)

Align rachiopy with the API docs

Separate the CONTROLLER AND USER from the SMART HOSE TIMER services as described in the Rachio API reference.

  • The base URLs can be separated
  • The classes can be renamed to Services (as in the docs)

These changes would be breaking and thus would require rachiopy to get a major version upgrade (2.x).

notification.add and notification.update json errors

Calling notification.add and notification.update methods producing errors as shown below.

({'date': 'Tue, 06 Oct 2020 15:41:09 GMT', 'content-type': 'application/json;charset=utf-8', 'content-length': '226', 'connection': 'keep-alive', 'server': 'nginx/1.12.1', 'cache-control': 'no-cache, no-store, max-age=0, must-revalidate', 'pragma': 'no-cache', 'expires': '0', 'x-xss-protection': '1; mode=block', 'x-frame-options': 'DENY', 'x-content-type-options': 'nosniff', 'x-ratelimit-limit': '1700', 'x-ratelimit-remaining': '1584', 'x-ratelimit-reset': '2020-10-07T00:00:00Z', 'status': 500}, {'code': '400', 'error': "Unrecognized token 'device': was expecting ('true', 'false' or 'null')\n at [Source: org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream@1a01b38c; line: 1, column: 8]"})

Also see comment: #30 (comment)

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.