-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathASEzSrveWebController.m
649 lines (503 loc) · 20.3 KB
/
ASEzSrveWebController.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
//
// ASEzSrveWebController.m
// Shion Framework
//
// Created by Chris Karr on 2/15/10.
// Copyright 2010 Audacious Software. All rights reserved.
//
#import "ASEzSrveWebController.h"
#import "ASInsteonAddress.h"
#import "ASX10Address.h"
#import "ASCommands.h"
#import "ASInsteonDatabase.h"
#import "ASThermostatDevice.h"
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include <netdb.h>
#define COMMAND_XML @"Command XML"
@implementation ASEzSrveWebController
+ (NSString *) findController
{
NSString * controllerAddress = nil;
// Send ping...
// Adapted from http://www.abc.se/~m6695/udp.html
int sd;
struct sockaddr_in server;
struct hostent *hp, *gethostbyname();
sd = socket (AF_INET,SOCK_DGRAM,0);
server.sin_family = AF_INET;
hp = gethostbyname("224.0.5.128");
bcopy(hp->h_addr, &(server.sin_addr.s_addr), hp->h_length);
server.sin_port = htons(2362);
unsigned char buf[] = { 0x44, 0x56, 0x4b, 0x54, 0x00, 0x01,
0x00, 0x1c, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0x14, 0x02, 0x02, 0x00,
0x15, 0x10, 0xbf, 0x6d, 0xb4, 0x09,
0xc8, 0x3d, 0x44, 0xa3, 0xa3, 0x6d,
0x21, 0x79, 0x7d, 0x2f, 0x73, 0xf9 };
unsigned char recvBuf[1024];
if (sendto(sd, buf, 36, 0, (struct sockaddr *) &server, sizeof(server)) != -1)
{
socklen_t length = 0;
struct timeval timeout;
timeout.tv_sec = 3;
timeout.tv_usec = 0;
fd_set rfds;
FD_ZERO(&rfds);
FD_SET(sd, &rfds);
if (select(1 + sd, &rfds, NULL, NULL, &timeout) > 0)
{
if (recvfrom(sd, recvBuf, 1024, 0, (struct sockaddr *) &server, &length) != -1)
controllerAddress = [NSString stringWithFormat:@"%d.%d.%d.%d", recvBuf[38], recvBuf[39], recvBuf[40], recvBuf[41]];
ShionLog([NSString stringWithFormat:@"Found EZServe at %@", controllerAddress]);
}
else
{
ShionLog(@"No EZSrve controllers found");
}
close(sd);
}
return controllerAddress;
}
- (void) processDeviceElement:(NSXMLElement *) deviceElement
{
NSString * devCat = [[deviceElement attributeForName:@"DevCat"] stringValue];
if ([devCat isEqual:@"0x0305"]) // EZSrve
{
NSMutableDictionary * userInfo = [NSMutableDictionary dictionary];
[userInfo setValue:STATUS_UPDATE forKey:COMMAND_TYPE];
[userInfo setValue:CONTROLLER_DEVICE forKey:DEVICE_TYPE];
[userInfo setValue:[[deviceElement attributeForName:@"Name"] stringValue] forKey:DEVICE_NAME];
NSMutableString * deviceAddress = [NSMutableString stringWithString:[[deviceElement attributeForName:@"ID"] stringValue]];
[deviceAddress replaceOccurrencesOfString:@"." withString:@"" options:0 range:NSMakeRange(0, [deviceAddress length])];
[userInfo setValue:deviceAddress forKey:DEVICE_ADDRESS];
[userInfo setValue:@"SimpleHomeNet EZServe 2.0" forKey:DEVICE_MODEL];
NSArray * firmwareNodes = [deviceElement nodesForXPath:@"Clusters/Cluster" error:NULL];
NSEnumerator * iter = [firmwareNodes objectEnumerator];
NSXMLElement * node = nil;
while (node = [iter nextObject])
{
NSString * firmware = [[node attributeForName:@"PLMVersion"] stringValue];
if (firmware != nil)
[userInfo setValue:[NSNumber numberWithInt:[firmware doubleValue]] forKey:DEVICE_FIRMWARE];
}
[[NSNotificationCenter defaultCenter] postNotificationName:DEVICE_UPDATE_NOTIFICATION object:nil userInfo:userInfo];
}
else
{
NSMutableDictionary * userInfo = [NSMutableDictionary dictionary];
[userInfo setValue:STATUS_UPDATE forKey:COMMAND_TYPE];
NSMutableString * deviceAddress = [NSMutableString stringWithString:[[deviceElement attributeForName:@"ID"] stringValue]];
[deviceAddress replaceOccurrencesOfString:@"." withString:@"" options:0 range:NSMakeRange(0, [deviceAddress length])];
[userInfo setValue:deviceAddress forKey:DEVICE_ADDRESS];
[userInfo setValue:[ASInsteonDatabase stringForDeviceTypeString:[[deviceElement attributeForName:@"DevCat"] stringValue]] forKey:DEVICE_MODEL];
NSArray * clusterNodes = [deviceElement nodesForXPath:@"Clusters/Cluster" error:NULL];
NSEnumerator * iter = [clusterNodes objectEnumerator];
NSXMLElement * cluster = nil;
while (cluster = [iter nextObject])
{
NSString * status = [[cluster attributeForName:@"Status"] stringValue];
if (status != nil)
{
NSScanner * scanner = [NSScanner scannerWithString:status];
unsigned value = 0;
if ([scanner scanHexInt:&value])
[userInfo setValue:[NSNumber numberWithUnsignedInt:value] forKey:DEVICE_STATE];
}
NSString * temperature = [[cluster attributeForName:@"Temp"] stringValue];
if (temperature != nil)
{
NSScanner * scanner = [NSScanner scannerWithString:temperature];
unsigned value = 0;
if ([scanner scanHexInt:&value])
[userInfo setValue:[NSNumber numberWithUnsignedInt:(value / 2)] forKey:THERMOSTAT_TEMPERATURE];
}
NSString * coolPoint = [[cluster attributeForName:@"CoolSetPoint"] stringValue];
if (coolPoint != nil)
{
NSScanner * scanner = [NSScanner scannerWithString:coolPoint];
unsigned value = 0;
if ([scanner scanHexInt:&value] && value > 0)
[userInfo setValue:[NSNumber numberWithUnsignedInt:(value / 2)] forKey:THERMOSTAT_COOL_POINT];
}
NSString * heatPoint = [[cluster attributeForName:@"HeatSetPoint"] stringValue];
if (heatPoint != nil)
{
NSScanner * scanner = [NSScanner scannerWithString:heatPoint];
unsigned value = 0;
if ([scanner scanHexInt:&value] && value > 0)
[userInfo setValue:[NSNumber numberWithUnsignedInt:(value / 2)] forKey:THERMOSTAT_HEAT_POINT];
}
NSString * mode = [[cluster attributeForName:@"Mode"] stringValue];
if (mode != nil)
{
NSScanner * scanner = [NSScanner scannerWithString:mode];
unsigned value = 0;
if ([scanner scanHexInt:&value])
[userInfo setValue:[NSNumber numberWithUnsignedInt:value] forKey:THERMOSTAT_MODE];
}
}
[[NSNotificationCenter defaultCenter] postNotificationName:DEVICE_UPDATE_NOTIFICATION object:nil userInfo:userInfo];
}
}
- (void) processXmlDocument:(NSXMLDocument *) document
{
ShionLog(@"Received XML: %@", document);
NSXMLElement * element = [document rootElement];
if ([[[element attributeForName:@"Status"] stringValue] hasPrefix:@"In Progress"])
return;
NSArray * devicesElements = [element elementsForName:@"Devices"];
if ([devicesElements count] > 0)
{
NSArray * deviceElements = [[devicesElements lastObject] elementsForName:@"Device"];
NSEnumerator * iter = [deviceElements objectEnumerator];
NSXMLElement * deviceElement = nil;
while (deviceElement = [iter nextObject])
[self processDeviceElement:deviceElement];
}
ready = YES;
}
- (void) stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode
{
if (eventCode == NSStreamEventHasBytesAvailable)
{
if ([aStream isKindOfClass:[NSInputStream class]])
{
NSInputStream * _in = (NSInputStream *) aStream;
unsigned char readBuffer[1024];
int read = 0;
while ([_in hasBytesAvailable])
{
read = [_input read:readBuffer maxLength:1024];
if (read > 0)
[readData appendBytes:readBuffer length:read];
}
NSString * xmlString = [[[NSString alloc] initWithData:readData encoding:NSUTF8StringEncoding] autorelease];
// xmlString = [xmlString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSRange range = [xmlString rangeOfString:@"</Response>"];
if (range.location != NSNotFound)
{
xmlString = [xmlString substringToIndex:(range.location + range.length)];
NSError * error = nil;
NSXMLDocument * document = [[NSXMLDocument alloc] initWithXMLString:xmlString options:0 error:&error]; // initWithData:[xmlString dataUsingEncoding:NSUTF8StringEncoding] options:0 error:&error];
if (document != nil)
{
[self processXmlDocument:document];
[readData setData:[NSData data]];
}
[document release];
}
}
}
}
- (NSString *) insteonCommandForAddress:(NSData *) addressBytes cmdOne:(unsigned char) one cmdTwo:(unsigned char) two
{
NSMutableString * command = [NSMutableString string];
if ([addressBytes length] > 2)
{
unsigned char * insteonAddress = (unsigned char *) [addressBytes bytes];
[command appendFormat:@"<Command Name=\"SendInsteon\" ID=\"%02X.%02X.%02X\">", insteonAddress[0], insteonAddress[1], insteonAddress[2]];
[command appendFormat:@"<CommandDetail Cmd1=\"0x%02X\" Cmd2=\"0x%02X\"/>", one, two];
[command appendString:@"</Command>\n"];
}
return command;
}
- (NSString *) insteonStatusCommandForAddress:(NSData *) addressBytes productCode:(NSString *) code;
{
NSMutableString * command = [NSMutableString string];
if ([addressBytes length] > 2)
{
unsigned char * insteonAddress = (unsigned char *) [addressBytes bytes];
NSString * deviceId = [NSString stringWithFormat:@"%02X.%02X.%02X", insteonAddress[0], insteonAddress[1], insteonAddress[2]];
if ([knownDevices containsObject:deviceId])
return @"<Command Name=\"Read\" File=\"Devices\" />";
else
{
[command appendString:@"<Command Name=\"Write\" File=\"Devices\">"];
[command appendFormat:@"<Device Name=\"%@\" ID=\"%@\" />", deviceId, deviceId];
[command appendString:@"</Command>\n"];
[knownDevices addObject:deviceId];
}
}
return command;
}
- (NSString *) xTenCommandForAddress:(NSString *) xTenAddress command:(NSString *) command
{
NSMutableString * xml = [NSMutableString string];
if ([xTenAddress length] > 1)
{
[xml appendFormat:@"<Command Name=\"SendX10\" House=\"%@\" Unit=\"%@\" Cmd=\"%@\"/>\n",
[xTenAddress substringWithRange:NSMakeRange(0, 1)], [xTenAddress substringFromIndex:1], command];
}
return xml;
}
- (ASCommand *) commandForDevice: (ASDevice *)device kind:(unsigned int) commandKind value:(NSObject *) value;
{
ASCommand * command = [super commandForDevice:device kind:commandKind value:value];
ASAddress * deviceAddress = [device getAddress];
if ([deviceAddress isKindOfClass:[ASInsteonAddress class]])
{
NSData * addressBytes = [((ASInsteonAddress *) deviceAddress) getAddress];
if ([command isMemberOfClass:[ASSetLevelCommand class]])
{
unsigned char level = [((NSNumber *) value) unsignedCharValue];
[command setValue:[self insteonCommandForAddress:addressBytes cmdOne:0x11 cmdTwo:level] forKey:COMMAND_XML];
}
else if ([command isMemberOfClass:[ASSetThermostatModeCommand class]])
{
unsigned char newMode = 0x00;
if ([device isKindOfClass:[ASThermostatDevice class]])
{
unsigned char mode = [((NSNumber *) value) unsignedCharValue];
if (mode == MODE_OFF)
newMode = 0x09;
else if (mode == MODE_HEAT)
newMode = 0x04;
else if (mode == MODE_COOL)
newMode = 0x05;
else if (mode == MODE_AUTO)
newMode = 0x06;
else if (mode == MODE_FAN)
newMode = 0x07;
else if (mode == MODE_FAN_OFF)
newMode = 0x08;
else if (mode == MODE_PROGRAM)
newMode = 0x0c;
else if (mode == MODE_PROGRAM_HEAT)
newMode = 0x0a;
else if (mode == MODE_PROGRAM_COOL)
newMode = 0x0c;
}
[command setValue:[self insteonCommandForAddress:addressBytes cmdOne:0x6b cmdTwo:newMode] forKey:COMMAND_XML];
}
else if ([command isMemberOfClass:[ASSetCoolPointCommand class]])
{
unsigned char point = [((NSNumber *) value) unsignedCharValue] * 2;
[command setValue:[self insteonCommandForAddress:addressBytes cmdOne:0x6c cmdTwo:point] forKey:COMMAND_XML];
}
else if ([command isMemberOfClass:[ASSetHeatPointCommand class]])
{
unsigned char point = [((NSNumber *) value) unsignedCharValue] * 2;
[command setValue:[self insteonCommandForAddress:addressBytes cmdOne:0x6d cmdTwo:point] forKey:COMMAND_XML];
}
else if ([command isMemberOfClass:[ASSprinklerOnCommand class]])
{
unsigned char unit = [((NSNumber *) value) unsignedCharValue];
[command setValue:[self insteonCommandForAddress:addressBytes cmdOne:0x40 cmdTwo:unit] forKey:COMMAND_XML];
}
else if ([command isMemberOfClass:[ASSprinklerOffCommand class]])
{
unsigned int unit = [((NSNumber *) value) unsignedCharValue];
[command setValue:[self insteonCommandForAddress:addressBytes cmdOne:0x41 cmdTwo:unit] forKey:COMMAND_XML];
}
else if ([command isKindOfClass:[ASSprinklerSetConfigurationCommand class]])
{
ASSprinklerSetConfigurationCommand * sprinklerCommand = (ASSprinklerSetConfigurationCommand *) command;
BOOL enabled = [sprinklerCommand enabled];
unsigned char commandByte = 0x02;
if ([sprinklerCommand isMemberOfClass:[ASSprinklerSetDiagnosticsConfiguration class]])
{
if (enabled)
commandByte = 0xFE;
else
commandByte = 0xFF;
}
else if ([sprinklerCommand isMemberOfClass:[ASSprinklerSetPumpConfigurationCommand class]])
{
if (enabled)
commandByte = 0x07;
else
commandByte = 0x08;
}
else if ([sprinklerCommand isMemberOfClass:[ASSprinklerSetRainSensorConfigurationCommand class]])
{
if (enabled)
commandByte = 0x0b;
else
commandByte = 0x0c;
}
[command setValue:[self insteonCommandForAddress:addressBytes cmdOne:0x44 cmdTwo:commandByte] forKey:COMMAND_XML];
}
}
// TODO: X10 Set Level Support
return command;
}
- (ASCommand *) commandForDevice:(ASDevice *) device kind:(unsigned int) commandKind
{
ASCommand * command = nil;
ASAddress * deviceAddress = [device getAddress];
if ([deviceAddress isMemberOfClass:[ASInsteonAddress class]])
{
NSData * addressBytes = [((ASInsteonAddress *) deviceAddress) getAddress];
command = [super commandForDevice:device kind:commandKind];
if (![self acceptsCommand:command])
return nil;
if ([command isKindOfClass:[ASStatusCommand class]])
[command setValue:[self insteonStatusCommandForAddress:addressBytes productCode:[device productCode]] forKey:COMMAND_XML];
if ([command isMemberOfClass:[ASActivateCommand class]])
[command setValue:[self insteonCommandForAddress:addressBytes cmdOne:0x11 cmdTwo:0xff] forKey:COMMAND_XML];
else if ([command isMemberOfClass:[ASDeactivateCommand class]])
[command setValue:[self insteonCommandForAddress:addressBytes cmdOne:0x13 cmdTwo:0x00] forKey:COMMAND_XML];
else if ([command isMemberOfClass:[ASActivateFanCommand class]])
[command setValue:[self insteonCommandForAddress:addressBytes cmdOne:0x6b cmdTwo:0x07] forKey:COMMAND_XML];
else if ([command isMemberOfClass:[ASDeactivateFanCommand class]])
[command setValue:[self insteonCommandForAddress:addressBytes cmdOne:0x6b cmdTwo:0x08] forKey:COMMAND_XML];
}
else if ([deviceAddress isMemberOfClass:[ASX10Address class]])
{
command = [super commandForDevice:device kind:commandKind];
if (![self acceptsCommand:command])
return nil;
NSString * unit = [((ASX10Address *) [device getAddress]) getAddress];
if ([command isMemberOfClass:[ASAllOffCommand class]])
[command setValue:[self xTenCommandForAddress:unit command:@"All-Units-OFF"] forKey:COMMAND_XML];
else if ([command isMemberOfClass:[ASAllLightsOffCommand class]])
[command setValue:[self xTenCommandForAddress:unit command:@"All-Lights-OFF"] forKey:COMMAND_XML];
if ([command isMemberOfClass:[ASAllLightsOnCommand class]])
[command setValue:[self xTenCommandForAddress:unit command:@"All-Lights-ON"] forKey:COMMAND_XML];
else if ([command isMemberOfClass:[ASChimeCommand class]])
[command setValue:[self xTenCommandForAddress:unit command:@"ON"] forKey:COMMAND_XML];
else if ([command isMemberOfClass:[ASActivateCommand class]])
[command setValue:[self xTenCommandForAddress:unit command:@"ON"] forKey:COMMAND_XML];
else if ([command isMemberOfClass:[ASDeactivateCommand class]])
[command setValue:[self xTenCommandForAddress:unit command:@"OFF"] forKey:COMMAND_XML];
else if ([command isMemberOfClass:[ASIncreaseCommand class]])
[command setValue:[self xTenCommandForAddress:unit command:@"Bright"] forKey:COMMAND_XML];
else if ([command isMemberOfClass:[ASDecreaseCommand class]])
[command setValue:[self xTenCommandForAddress:unit command:@"Dim"] forKey:COMMAND_XML];
}
return command;
}
- (void) next:(NSTimer *) theTimer
{
if (!ready)
return;
if ([commandQueue count] > 0)
{
ASCommand * command = [commandQueue objectAtIndex:0];
if ([command isKindOfClass:[ASAggregateCommand class]])
{
NSMutableArray * cmds = [NSMutableArray arrayWithArray:[((ASAggregateCommand *) command) commands]];
while ([cmds count] > 0)
{
ASCommand * aggCmd = [cmds lastObject];
if ([self acceptsCommand:aggCmd])
[commandQueue insertObject:aggCmd atIndex:0];
[cmds removeObject:aggCmd];
}
}
else
{
NSString * xml = [command valueForKey:COMMAND_XML];
if (xml != nil)
{
ShionLog(@"Sending: %@", xml);
NSData * data = [xml dataUsingEncoding:NSASCIIStringEncoding];
if ([_output write:[data bytes] maxLength:[data length]] == -1)
ShionLog(@"Error sending command '%@'.", xml);
ready = NO;
}
}
[commandQueue removeObject:command];
}
}
- (void) fetchDevices
{
NSString * xml = @"<Command Name=\"Read\" File=\"Devices\" />";
NSData * data = [xml dataUsingEncoding:NSASCIIStringEncoding];
ShionLog(@"Sending %@", xml);
if ([_output write:[data bytes] maxLength:[data length]] == -1)
ShionLog(@"Error sending command '%@'.", xml);
}
- (void) resetDevice
{
NSString * xml = @"<Command Name=\"ClearFlash\" />";
NSData * data = [xml dataUsingEncoding:NSASCIIStringEncoding];
ShionLog(@"Sending %@", xml);
if ([_output write:[data bytes] maxLength:[data length]] == -1)
ShionLog(@"Error sending command '%@'.", xml);
}
- (ASEzSrveWebController *) initWithHost:(NSString *) host
{
if (self = [super init])
{
_input = nil;
_output = nil;
_host = [host retain];
[NSStream getStreamsToHost:[NSHost hostWithAddress:host] port:8002 inputStream:&_input outputStream:&_output];
[_input retain];
[_input setDelegate:self];
[_input scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
[_input open];
[_output retain];
[_output setDelegate:self];
[_output scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
[_output open];
ready = YES;
knownDevices = [[NSMutableSet alloc] init];
readData = [[NSMutableData data] retain];
// [self resetDevice];
_refreshTimer = [[NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(next:) userInfo:nil repeats:YES] retain];
}
return self;
}
- (BOOL) acceptsCommand: (ASCommand *) command;
{
if ([command isMemberOfClass:[ASStatusCommand class]])
return YES;
else if ([command isMemberOfClass:[ASGetInfoCommand class]])
return YES;
else if ([command isMemberOfClass:[ASActivateCommand class]])
return YES;
else if ([command isMemberOfClass:[ASDeactivateCommand class]])
return YES;
else if ([command isMemberOfClass:[ASSetLevelCommand class]])
return YES;
else if ([command isMemberOfClass:[ASGetTemperatureCommand class]])
return YES;
else if ([command isMemberOfClass:[ASGetThermostatModeCommand class]])
return YES;
else if ([command isMemberOfClass:[ASSetThermostatModeCommand class]])
return YES;
else if ([command isMemberOfClass:[ASGetThermostatState class]])
return YES;
else if ([command isMemberOfClass:[ASActivateThermostatStatusBroadcastCommand class]])
return YES;
else if ([command isMemberOfClass:[ASSetCoolPointCommand class]])
return YES;
else if ([command isMemberOfClass:[ASSetHeatPointCommand class]])
return YES;
else if ([command isMemberOfClass:[ASGetCoolPointCommand class]])
return YES;
else if ([command isMemberOfClass:[ASGetHeatPointCommand class]])
return YES;
else if ([command isMemberOfClass:[ASAggregateCommand class]])
return YES;
else if ([command isMemberOfClass:[ASIncreaseCommand class]])
return YES;
else if ([command isMemberOfClass:[ASDecreaseCommand class]])
return YES;
else if ([command isMemberOfClass:[ASActivateFanCommand class]])
return YES;
else if ([command isMemberOfClass:[ASDeactivateFanCommand class]])
return YES;
else if ([command isMemberOfClass:[ASChimeCommand class]])
return YES;
else if ([command isMemberOfClass:[ASAllOffCommand class]])
return YES;
else if ([command isMemberOfClass:[ASAllLightsOnCommand class]])
return YES;
else if ([command isMemberOfClass:[ASAllLightsOffCommand class]])
return YES;
else if ([command isMemberOfClass:[ASSprinklerOnCommand class]])
return YES;
else if ([command isMemberOfClass:[ASSprinklerOffCommand class]])
return YES;
else if ([command isKindOfClass:[ASSprinklerSetConfigurationCommand class]])
return YES;
return NO;
}
@end