Exemple #1
0
        public void Configure(INetDaemonRxApp app)
        {
            _app = app;

            Lights = new List <LightEntityDummy>();
            foreach (var entityId in FilterControlEntities("light."))
            {
                Lights.Add(new LightEntityDummy(app, new[] { entityId }));
            }

            Switches = new List <LightEntityDummy>();
            foreach (var entityId in FilterControlEntities("switch."))
            {
                Switches.Add(new LightEntityDummy(app, new[] { entityId }));
            }

            PresenceSensors = new List <BinarySensorEntity>();
            foreach (var entityId in _config.PresenceEntityIds.Union(_config.KeepAliveEntityIds))
            {
                PresenceSensors.Add(new BinarySensorEntity(app, new[] { entityId }));
            }


            NightTime = new BinarySensorEntity(app, new[] { _config.NightTimeEntityId });
        }
Exemple #2
0
 public static IObservable <StateChange <BinarySensorEntity, EntityState <BinarySensorAttributes> > > StateAllChangesWithCurrent(this BinarySensorEntity entity)
 {
     return(entity.StateAllChangesWithCurrent <BinarySensorEntity, EntityState <BinarySensorAttributes>, BinarySensorAttributes>());
 }