Last update for visual notifications : #307

This commit is contained in:
ccostan 2018-02-04 16:15:39 -05:00
parent 0a4b16736d
commit df4b97bfce
2 changed files with 13 additions and 19 deletions

View File

@ -58,8 +58,9 @@ class MCServerSensor(Entity):
"""Update device state.""" """Update device state."""
status = self._mcserver.lookup(self._server).status() status = self._mcserver.lookup(self._server).status()
query = self._mcserver.lookup(self._server).query() query = self._mcserver.lookup(self._server).query()
self._state = str(status.players.online) self._state = status.players.online
self._max = str(status.players.max) #self._max = str(status.players.max)
self._max = status.players.max
self._users = query.players.names self._users = query.players.names
self._motd = query.motd self._motd = query.motd
self._version = query.software.version self._version = query.software.version

View File

@ -32,24 +32,9 @@ automation:
- platform: state - platform: state
entity_id: sensor.bear_stone entity_id: sensor.bear_stone
condition:
- condition: template
value_template: >
{% if states.sensor.bear_stone.state|int == 0 %}
false
{% else %}
true
{% endif %}
action: action:
- service_template: > - service: light.turn_on
{% if states.sensor.bear_stone.state|int > 0 %} entity_id: light.justin_go
light.turn_on
{% else %}
light.turn_off
{% endif %}
entity_id:
- light.justin_go
data_template: data_template:
color_name: > color_name: >
{% if states.sensor.bear_stone.state|int == 1 %} {% if states.sensor.bear_stone.state|int == 1 %}
@ -67,3 +52,11 @@ automation:
- light.justin_go - light.justin_go
data: data:
flash: long 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