-
-
Notifications
You must be signed in to change notification settings - Fork 575
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
Support for pronto codes on chuangmi.remote.h102a03 #501
Conversation
'cython', | ||
'heatshrink @ git+https://github.com/yawor/pyheatshrink@py3fix', | ||
] | ||
except: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use bare 'except'
@@ -6,6 +6,10 @@ | |||
Struct, Const, Rebuild, this, len_, Adapter, Computed, | |||
Int16ul, Int32ul, Int16ub, Array, BitStruct, BitsInteger, | |||
) | |||
try: | |||
import heatshrink | |||
except: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use bare 'except'
@@ -145,6 +149,18 @@ def play(self, command: str): | |||
return play_method(command, *command_args) | |||
|
|||
|
|||
class ChuangmiRemote(ChuangmiIr): | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a short docstring to explain what type of device this is, and why it requires overloading? For future readers :-)
pkg_resources.get_distribution('pip>=18.1') | ||
heatshrink_requirement = [ | ||
'cython', | ||
'heatshrink @ git+https://github.com/yawor/pyheatshrink@py3fix', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to add these to extras_require
? I hope that there will be a new pypi release for heatshrink with your fix, so that we need no git paths here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually that's not my fix. It was done by a different GitHub user some time ago, but the PR still waits to be merged. I've only created this fork to be 100% sure it won't suddenly disappear over night.
The extras_require may be a good option, but pip 18.1 or newer is still required to install patched version directly from git until a new version is released. Another way would be to temporarily publish a patched version to pypi under a different package name.
There's a chance for a new Heatshrink release on pypi. The PR has been merged few weeks ago, so I've asked if they could publish the new version. |
Great! This fine to be merged from my side after the new release can be added into the extras_require. |
@yawor any updates on this? |
I would love to use remote.v2 with pronto codes. Is there any way we can revive this PR? I'd be happy to help |
Solves rytilahti#495, rytilahti#619, rytilahti#811 Closes rytilahti#501 Partially covers rytilahti#1020
Fixes rytilahti#495, rytilahti#619, rytilahti#811 Closes rytilahti#501 Partially covers rytilahti#1020
Fixes rytilahti#495, fixes rytilahti#619, fixes rytilahti#811 Closes rytilahti#501 Partially covers rytilahti#1020
Fixes rytilahti#495, fixes rytilahti#619, fixes rytilahti#811 Closes rytilahti#501 Partially covers rytilahti#1020
Fixes rytilahti#495, fixes rytilahti#619, fixes rytilahti#811 Closes rytilahti#501 Partially covers rytilahti#1020
Fixes rytilahti#495, fixes rytilahti#619, fixes rytilahti#811 Closes rytilahti#501 Partially covers rytilahti#1020
Fixes rytilahti#495, fixes rytilahti#619, fixes rytilahti#811 Closes rytilahti#501 Partially covers rytilahti#1020
Fixes rytilahti#495, fixes rytilahti#619, fixes rytilahti#811 Closes rytilahti#501 Partially covers rytilahti#1020
All kudos to original work by @yawor's on PR rytilahti#501. Fixes rytilahti#495, fixes rytilahti#619, fixes rytilahti#811 Closes rytilahti#501 Partially covers rytilahti#1020
All kudos to original work by @yawor's on PR rytilahti#501. Fixes rytilahti#495, fixes rytilahti#619, fixes rytilahti#811 Closes rytilahti#501 Partially covers rytilahti#1020
All kudos to original work by @yawor's on PR rytilahti#501. Fixes rytilahti#495, fixes rytilahti#619, fixes rytilahti#811. Closes rytilahti#501. Partially covers rytilahti#1020.
All kudos to original work by @yawor's on PR rytilahti#501. Fixes rytilahti#495, fixes rytilahti#619, fixes rytilahti#811. Closes rytilahti#501. Partially covers rytilahti#1020.
All kudos to original work by @yawor's on PR rytilahti#501. Fixes rytilahti#495, fixes rytilahti#619, fixes rytilahti#811. Closes rytilahti#501. Partially covers rytilahti#1020.
A separate device class for ChuangmiRemote. It subclasses ChuangmiIr and overrides
pronto_to_raw
class method to apply new learned signal encoding scheme.It requires two new dependencies: cython and heatshrink.
There's a Python 3 compatibility issue with current version of heatshrink on PyPi, as johan-sports/pyheatshrink#15 waits to be merged for quite some time now. Because of that I've forked the library and applied the patch from PR and I've added dependency on the fork. For the library to install automatically from the git, a
pip>=18.1
is required, as that version added support for PEP 508 dependency specification. I've added a check to setup.py to make sure at least that version is installed before adding cython and heatshrink toinstall_requires
(it may still not work correctly ifpython setup.py install
is used instead of pip). I couldn't find a better way until heatshrink author merges the PR.I'm also waiting for confirmation in #495 to be sure that signals generated by the new implementation work correctly.