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

fix enclosure blink #7

Merged
merged 1 commit into from
Apr 25, 2024
Merged

fix enclosure blink #7

merged 1 commit into from
Apr 25, 2024

Conversation

JarbasAl
Copy link
Member

skill is mixing these 2 apis

    def system_blink(self, times):
        """The 'eyes' should blink the given number of times.
        Args:
            times (int): number of times to blink
        """
        source_message = self._get_source_message()
        self.bus.emit(source_message.forward("enclosure.system.blink",
                                             {'times': times}))
 
    def eyes_blink(self, side):
        """Make the eyes blink
        Args:
            side (str): 'r', 'l', or 'b' for 'right', 'left' or 'both'
        """
        source_message = self._get_source_message()
        self.bus.emit(source_message.forward("enclosure.eyes.blink",
                                             {'side': side}))

causing

Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]: 2024-04-24 20:14:35.323 - HiveMind-voice-sat - ovos_bus_client.client.client:on_error:120 - ERROR - === TypeError('can only concatenate str (not "int") to str') ===
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]: Traceback (most recent call last):
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/websocket/_app.py", line 660, in _callback
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     callback(self, *args)
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/hivemind_bus_client/client.py", line 243, in on_message
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     self._handle_hive_protocol(HiveMessage(**message))
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/hivemind_bus_client/client.py", line 248, in _handle_hive_protocol
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     self.internal_bus.emit(message.payload)
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/ovos_utils/fakebus.py", line 50, in emit
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     self.ee.emit(message.msg_type, message)
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/pyee/_base.py", line 115, in emit
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     handled = self._call_handlers(event, args, kwargs)
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/pyee/_base.py", line 98, in _call_handlers
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     self._emit_run(f, args, kwargs)
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/pyee/_base.py", line 83, in _emit_run
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     f(*args, **kwargs)
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/ovos_PHAL_plugin_mk1/__init__.py", line 296, in on_eyes_blink
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     self.writer.write("eyes.blink=" + side)
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:                       ~~~~~~~~~~~~~~^~~~~~
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]: TypeError: can only concatenate str (not "int") to str

skill is mixing these 2 apis

```
    def system_blink(self, times):
        """The 'eyes' should blink the given number of times.
        Args:
            times (int): number of times to blink
        """
        source_message = self._get_source_message()
        self.bus.emit(source_message.forward("enclosure.system.blink",
                                             {'times': times}))
 
    def eyes_blink(self, side):
        """Make the eyes blink
        Args:
            side (str): 'r', 'l', or 'b' for 'right', 'left' or 'both'
        """
        source_message = self._get_source_message()
        self.bus.emit(source_message.forward("enclosure.eyes.blink",
                                             {'side': side}))
```

causing

```
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]: 2024-04-24 20:14:35.323 - HiveMind-voice-sat - ovos_bus_client.client.client:on_error:120 - ERROR - === TypeError('can only concatenate str (not "int") to str') ===
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]: Traceback (most recent call last):
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/websocket/_app.py", line 660, in _callback
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     callback(self, *args)
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/hivemind_bus_client/client.py", line 243, in on_message
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     self._handle_hive_protocol(HiveMessage(**message))
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/hivemind_bus_client/client.py", line 248, in _handle_hive_protocol
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     self.internal_bus.emit(message.payload)
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/ovos_utils/fakebus.py", line 50, in emit
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     self.ee.emit(message.msg_type, message)
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/pyee/_base.py", line 115, in emit
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     handled = self._call_handlers(event, args, kwargs)
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/pyee/_base.py", line 98, in _call_handlers
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     self._emit_run(f, args, kwargs)
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/pyee/_base.py", line 83, in _emit_run
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     f(*args, **kwargs)
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:   File "/home/goldyfruit/.venvs/ovos/lib/python3.11/site-packages/ovos_PHAL_plugin_mk1/__init__.py", line 296, in on_eyes_blink
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:     self.writer.write("eyes.blink=" + side)
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]:                       ~~~~~~~~~~~~~~^~~~~~
Apr 24 20:14:35 mark1 hivemind-voice-sat[2934]: TypeError: can only concatenate str (not "int") to str
```
@JarbasAl JarbasAl added the bug Something isn't working label Apr 25, 2024
@JarbasAl JarbasAl requested a review from mikejgray April 25, 2024 00:21
@mikejgray mikejgray merged commit 689d349 into dev Apr 25, 2024
10 of 13 checks passed
@mikejgray mikejgray deleted the fix-enclosure-blink branch April 25, 2024 01:43
mikejgray added a commit that referenced this pull request Nov 5, 2024
* feat: first PyPi release (#6)

* feat: first PyPi release

* fix enclosure blink (#7)

* automations/translations

* translations/allow_UNUSED_keywords

* fix:long description (#11)

semver automations fail if dont use full path for README

* chore: new automations (#10)

* bump minimum version - icepool is only supported in Python 3.10+

* chore(automations): tidy up and get a release out (#13)

* Increment Version to 0.0.2a1

* Update Changelog

* fix: standard naming for PyPi (#14)

* Increment Version to 0.0.3a1

* Update Changelog

* feat: support more Python versions, fix workflows (#15)

* feat: support more Python versions (3.9+), fix workflows

* Increment Version to 0.1.0a1

* Update Changelog

* fix: enable language support in LF

* address odd verison.py

* chore: remove old translation test file

---------

Co-authored-by: JarbasAI <33701864+JarbasAl@users.noreply.github.com>
Co-authored-by: miro <jarbasai@mailfence.com>
Co-authored-by: mikejgray <mikejgray@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants