看到老外都是用kindle fire 7平板放门口做中控面板,不过kindle fire性能太弱,据说显示这些CSS动画都会特别卡,我还没找到合适的平板,所以暂时弃坑。
运动传感器跟其他的是一样的,我没做闪烁,只是有个状态切换逐渐显隐的效果。
floorplan.yaml
- name: motionsensors
entities:
- binary_sensor.motion_sensor_1
- binary_sensor.motion_sensor_2
- binary_sensor.motion_sensor_3
states:
- state: 'on'
class: 'motion-on'
- state: 'off'
class: 'motion-off'
state_transitions:
- name: On to off
from_state: 'on'
to_state: 'off'
duration: 2
- name: Off to on
from_state: 'off'
to_state: 'on'
duration: 1
floorplan.css
.motion-off {
fill: #5b5b5b !important;
}
.motion-on {
fill: #bdf271 !important;
}
你做闪烁可以删掉 state_transitions:后边的部分
修改css为(没在家,未测试)
@-webkit-keyframes twinkling {
0% {
opacity: 0.1;
}
100% {
opacity: 1;
}
}
.motion-on {
fill: #bdf271 !important;
-webkit-animation: twinkling 1s infinite ease-in-out;
}
.motion-off {
fill: #5b5b5b !important;
}
|