tonesto7 / echo-speaks

Integrate your Amazon Echo devices into your Hubitat environment to create virtual Echo Devices. These virtual devices will allow you to speak text, make announcements, control media playback including volume, and many other Alexa features.
https://tonesto7.github.io/echo-speaks-docs/
110 stars 177 forks source link

Fixed online status check for TTS #977

Closed dds82 closed 2 years ago

dds82 commented 2 years ago

Bug: Getting "speechCmd Ignored... Device is OFFLINE" message even when the device was online. Fix: I noticed two different ways of checking whether the device was online. One seemed like it was only used by the TTS methods, so I removed that one and consolidated.

tonesto7 commented 2 years ago

Thanks for this. I just pushed out a new version with a slightly different approach.

dds82 commented 2 years ago

If I'm reading your push correctly, you added a new device preference to ignore the online/offline status. That would have solved my problem too, but I think the code is still inconsistent.

The reason behind my approach was that there are two code paths to speech, which were gated in the old version like so:

1) speak() -> checks isCommandTypeAllowed("TTS") -> speechCmd() -> checks healthStatus 2) parallelSpeak() -> speechCmd() -> checks healthStatus

The healthStatus check is what didn't work properly, and that's what it seems like you added the device preference to fix.

But you're still left with two code paths, where one checks isCommandTypeAllowed("TTS") and the other does not. Is that intentional? If not, you may want to manually make the change where I added that check to parallelSpeak().