Skip to content

Commit

Permalink
fix sticky old total time issue
Browse files Browse the repository at this point in the history
It seems that in order to clear old total time values emitting 0 to
totalTime is insufficient. Luckily it seems that by not sending a new
value SmartThings is clearing the value anyway when a new track is set.

Signed-off-by: alon-tchelet <[email protected]>
  • Loading branch information
alon-tchelet committed Jul 2, 2024
1 parent a3dc9a6 commit ad42c0d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/SmartThings/harman-luxury/src/hl_websocket.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ function HLWebsocket:received_msg_handler(msg)
trackdata.mediaSource = audioTrackData.mediaSource
end
self.device:emit_event(capabilities.audioTrackData.audioTrackData(trackdata))
self.device:emit_event(capabilities.audioTrackData.totalTime(totalTime or 0))
if totalTime and totalTime ~= 0 then
self.device:emit_event(capabilities.audioTrackData.totalTime(totalTime))
end
end
-- check for an elapsed time change
if msg[capabilities.audioTrackData.elapsedTime.NAME] then
Expand Down

0 comments on commit ad42c0d

Please sign in to comment.