Skip to content

Commit

Permalink
Merge pull request #5 from smartgic/dev
Browse files Browse the repository at this point in the history
1.0.0
  • Loading branch information
goldyfruit authored Jan 24, 2024
2 parents f41d8b7 + 7a03307 commit 950cdf5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
14 changes: 11 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
# Changelog

## [0.0.3a1](https://github.com/smartgic/ovos-phal-plugin-ww-led/tree/0.0.3a1) (2024-01-04)
## [0.1.1a2](https://github.com/smartgic/ovos-phal-plugin-ww-led/tree/0.1.1a2) (2024-01-24)

[Full Changelog](https://github.com/smartgic/ovos-phal-plugin-ww-led/compare/0.0.2...0.0.3a1)
[Full Changelog](https://github.com/smartgic/ovos-phal-plugin-ww-led/compare/0.1.1a1...0.1.1a2)

**Implemented enhancements:**

- Feat/cancelled event [\#4](https://github.com/smartgic/ovos-phal-plugin-ww-led/pull/4) ([goldyfruit](https://github.com/goldyfruit))

**Merged pull requests:**

- \[readme\] Update documentation [\#2](https://github.com/smartgic/ovos-phal-plugin-ww-led/pull/2) ([goldyfruit](https://github.com/goldyfruit))
- 0.0.3 [\#3](https://github.com/smartgic/ovos-phal-plugin-ww-led/pull/3) ([github-actions[bot]](https://github.com/apps/github-actions))

## [0.1.1a1](https://github.com/smartgic/ovos-phal-plugin-ww-led/tree/0.1.1a1) (2024-01-05)

[Full Changelog](https://github.com/smartgic/ovos-phal-plugin-ww-led/compare/0.1.0...0.1.1a1)



Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

A light _(LED)_ indicator when Open Voice OS is listening and/or speaking.

[![Video](https://img.youtube.com/vi/u3cftkais9s/maxresdefault.jpg)](https://www.youtube.com/watch?v=u3cftkais9s)

## About

This PHAL plugin interacts with a LED connected to a GPIO to let you know if Open Voice OS is listening. When a wake word is detected the LED turns on and when the audio output is over the LED turns off.
Expand Down
17 changes: 5 additions & 12 deletions ovos_phal_plugin_ww_led/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ def __init__(self, bus=None, config=None):

# Map bus events to methods
self.bus.on("recognizer_loop:record_begin", self._handle_listener_started)
self.bus.on("recognizer_loop:record_end", self._handle_listener_ended)
self.bus.on("recognizer_loop:audio_output_end", self._handle_audio_ended)
self.bus.on("recognizer_loop:record_end", self._handle_led_off)
self.bus.on("recognizer_loop:audio_output_end", self._handle_led_off)
self.bus.on("ovos.utterance.cancelled", self._handle_led_off)
except RuntimeError:
LOG.error("Cannot initialize GPIO - plugin will not load")

Expand Down Expand Up @@ -75,16 +76,8 @@ def _handle_listener_started(self, _):
else:
GPIO.output(self.gpio_pin, GPIO.HIGH)

def _handle_listener_ended(self, _):
"""Handle the record_end event detection and turn the LED off."""
if self.wakeword_only:
if self.pulse:
self.pulsing = False
else:
GPIO.output(self.gpio_pin, GPIO.LOW)

def _handle_audio_ended(self, _):
"""Handle the audio_output_end event detection and turn the LED off."""
def _handle_led_off(self, _):
"""Handle the different events that will lead to turn the LED off."""
if not self.wakeword_only:
if self.pulse:
self.pulsing = False
Expand Down
4 changes: 2 additions & 2 deletions ovos_phal_plugin_ww_led/version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# The following lines are replaced during the release process.
# START_VERSION_BLOCK
VERSION_MAJOR = 0
VERSION_MINOR = 1
VERSION_MAJOR = 1
VERSION_MINOR = 0
VERSION_BUILD = 0
VERSION_ALPHA = 0
# END_VERSION_BLOCK

0 comments on commit 950cdf5

Please sign in to comment.