From df4b97bfcebe5e1e197a2f7acdea97d3e5e344af Mon Sep 17 00:00:00 2001 From: ccostan Date: Sun, 4 Feb 2018 16:15:39 -0500 Subject: [PATCH] Last update for visual notifications : #307 --- custom_components/sensor/minecraft.py | 5 +++-- packages/minecraft.yaml | 27 ++++++++++----------------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/custom_components/sensor/minecraft.py b/custom_components/sensor/minecraft.py index cecc4724..ee2f6118 100755 --- a/custom_components/sensor/minecraft.py +++ b/custom_components/sensor/minecraft.py @@ -58,8 +58,9 @@ class MCServerSensor(Entity): """Update device state.""" status = self._mcserver.lookup(self._server).status() query = self._mcserver.lookup(self._server).query() - self._state = str(status.players.online) - self._max = str(status.players.max) + self._state = status.players.online + #self._max = str(status.players.max) + self._max = status.players.max self._users = query.players.names self._motd = query.motd self._version = query.software.version diff --git a/packages/minecraft.yaml b/packages/minecraft.yaml index db3cdcb3..17146a2c 100755 --- a/packages/minecraft.yaml +++ b/packages/minecraft.yaml @@ -32,24 +32,9 @@ automation: - platform: state entity_id: sensor.bear_stone - condition: - - condition: template - value_template: > - {% if states.sensor.bear_stone.state|int == 0 %} - false - {% else %} - true - {% endif %} - action: - - service_template: > - {% if states.sensor.bear_stone.state|int > 0 %} - light.turn_on - {% else %} - light.turn_off - {% endif %} - entity_id: - - light.justin_go + - service: light.turn_on + entity_id: light.justin_go data_template: color_name: > {% if states.sensor.bear_stone.state|int == 1 %} @@ -67,3 +52,11 @@ automation: - light.justin_go data: flash: long + + - service_template: > + {% if states.sensor.bear_stone.state|int > 0 %} + light.turn_on + {% else %} + light.turn_off + {% endif %} + entity_id: light.justin_go