Skip to content

Commit

Permalink
Home Accessory Architect v0.6.10
Browse files Browse the repository at this point in the history
  • Loading branch information
RavenSystem committed Nov 12, 2019
1 parent a3e3651 commit 282ede6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
20 changes: 15 additions & 5 deletions devices/HAA/main.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Home Accessory Architect
*
* v0.6.9
* v0.6.10
*
* Copyright 2019 José Antonio Jiménez Campos (@RavenSystem)
*
Expand Down Expand Up @@ -46,8 +46,8 @@
#include <cJSON.h>

// Version
#define FIRMWARE_VERSION "0.6.9"
#define FIRMWARE_VERSION_OCTAL 000611 // Matches as example: firmware_revision 2.3.8 = 02.03.10 (octal) = config_number 020310
#define FIRMWARE_VERSION "0.6.10"
#define FIRMWARE_VERSION_OCTAL 000612 // Matches as example: firmware_revision 2.3.8 = 02.03.10 (octal) = config_number 020310

// Characteristic types (ch_type)
#define CH_TYPE_BOOL 0
Expand Down Expand Up @@ -442,6 +442,13 @@ void hkc_group_notify(homekit_characteristic_t *ch) {
}
}
}

if (ch_group->ch_child) {
homekit_characteristic_notify(ch_group->ch_child, ch_group->ch_child->value);
}
if (ch_group->ch_sec) {
homekit_characteristic_notify(ch_group->ch_sec, ch_group->ch_sec->value);
}
}

homekit_value_t hkc_getter(const homekit_characteristic_t *ch) {
Expand Down Expand Up @@ -1580,7 +1587,6 @@ void normal_mode_init() {
accessories[accessory]->services[1]->characteristics[0] = ch;

ch->value.bool_value = (bool) set_initial_state(accessory, 0, json_context, ch, CH_TYPE_BOOL, 0);
//homekit_characteristic_notify(ch, ch->value);

return ch;
}
Expand Down Expand Up @@ -1631,10 +1637,14 @@ void normal_mode_init() {
accessories[accessory]->services[1]->characteristics = calloc(2, sizeof(homekit_characteristic_t*));
accessories[accessory]->services[1]->characteristics[0] = ch0;
} else { // acc_type == ACC_TYPE_OUTLET
homekit_characteristic_t *ch1 = NEW_HOMEKIT_CHARACTERISTIC(OUTLET_IN_USE, true, .getter_ex=hkc_getter, .context=json_context);

accessories[accessory]->services[1]->type = HOMEKIT_SERVICE_OUTLET;
accessories[accessory]->services[1]->characteristics = calloc(3, sizeof(homekit_characteristic_t*));
accessories[accessory]->services[1]->characteristics[0] = ch0;
accessories[accessory]->services[1]->characteristics[1] = NEW_HOMEKIT_CHARACTERISTIC(OUTLET_IN_USE, true, .getter_ex=hkc_getter, .context=json_context);
accessories[accessory]->services[1]->characteristics[1] = ch1;

ch_group->ch1 = ch1;
}

diginput_register(cJSON_GetObjectItem(json_context, BUTTONS_ARRAY), diginput, ch0, TYPE_ON);
Expand Down
2 changes: 1 addition & 1 deletion external_libs/wifi_config_haa/content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
.nonetworks{text-align:center;margin:1em 0;}
.field{margin-bottom:0.5em;}
.field.required label::before{content:"*";color:red;}
</style></head><body><div class="container"><h1>Home Accessory Architect v0.6.9</h1>
</style></head><body><div class="container"><h1>Home Accessory Architect v0.6.10</h1>
<form action="/settings" method="post">
<div class="field required conf">
<label for="conf">JSON Config:</label>
Expand Down

0 comments on commit 282ede6

Please sign in to comment.