Any idea why hapush would be picking up some events from HA and not others?
I have no problem with some input_booleans, for example, I can toggle those in HA dev console and the new states show up fine in HADashboard (and the hapush console log).
However, for my new habinary widget, hapush isn’t picking up the changes. For example, I set binary_sensor.garage_double_bay to “off” using the dev console in HA, and nothing shows in hapush. If I manually refresh the dashboard, the new state shows up fine.
Here’s my habinary.coffee, not sure if relevant:
class Dashing.Habinary extends Dashing.Widget
constructor: ->
super
@queryState()
@accessor 'state',
get: -> @_state ? "off"
set: (key, value) -> @_state = value
@accessor 'icon',
get: -> if @['icon'] then @['icon'] else
if @get('state') == 'on' then @get('iconon') else @get('iconoff')
set: Batman.Property.defaultAccessor.set
@accessor 'iconon',
get: -> @['iconon'] ? 'circle'
set: Batman.Property.defaultAccessor.set
@accessor 'iconoff',
get: -> @['iconoff'] ? 'circle-o'
set: Batman.Property.defaultAccessor.set
@accessor 'icon-style', ->
if @get('state') == 'on' then 'binary-icon-on' else 'binary-icon-off'
queryState: ->
$.get '/homeassistant/motion',
widgetId: @get('id')
(data) =>
json = JSON.parse data
@set 'state', json.state
ready: ->
# This is fired when the widget is done being rendered
if @get('bgcolor')
$(@node).css("background-color", @get('bgcolor'))
else
$(@node).css("background-color", "#444")
And the hapush console log, showing a successful input_boolean push but absolutely nothing for my binary_sensor:
(venv) ➜ hapush git:(development) ✗ python3 hapush.py hapush.cfg
2016-10-06 16:36:12,323 INFO Reading dashboard: /Users/mrogers/Projects/hadashboard/dashboards/example.erb
2016-10-06 16:36:12,324 INFO Reading dashboard: /Users/mrogers/Projects/hadashboard/dashboards/main.erb
2016-10-06 16:50:57,611 INFO input_boolean.guests -> on
2016-10-06 16:51:00,325 INFO input_boolean.guests -> off