Last update for visual notifications : #307

pull/310/head
ccostan 8 years ago
parent 0a4b16736d
commit df4b97bfce

@ -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

@ -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

Loading…
Cancel
Save

Powered by TurnKey Linux.