public override IThingHandler CreateThingHandler(IThingSetupInfo thingSetupInfo) { var thingType = thingSetupInfo.ReadSetting <string>("Type"); return(thingType?.Equals("WlanDevice", StringComparison.InvariantCultureIgnoreCase) == true ? new FritzBoxWlanDeviceThingHandler(thingSetupInfo, _fritzBox) : null); }
public FritzBoxWlanDeviceThingHandler(IThingSetupInfo thingSetupInfo, FritzBox fritzBox) { _thingSetupInfo = thingSetupInfo; _fritzBox = fritzBox; _isActiveChannelHandler = new SimpleThingChannelHandler <bool>(_thingSetupInfo.Id, "IsActive"); _lastConnectChannelHandler = new SimpleThingChannelHandler <DateTime>(_thingSetupInfo.Id, "LastConnect"); _lastDisconnectChannelHandler = new SimpleThingChannelHandler <DateTime>(_thingSetupInfo.Id, "LastDisconnect"); _hostAddress = _thingSetupInfo.Address; _interval = _thingSetupInfo.ReadSetting("Interval", 10000); }