diff --git a/api/beestat.sql b/api/beestat.sql index 7f44259..c437775 100644 --- a/api/beestat.sql +++ b/api/beestat.sql @@ -613,7 +613,6 @@ CREATE TABLE `thermostat` ( `thermostat_id` int unsigned NOT NULL AUTO_INCREMENT, `user_id` int unsigned NOT NULL, `ecobee_thermostat_id` int unsigned DEFAULT NULL, - `thermostat_group_id` int unsigned DEFAULT NULL, `address_id` int unsigned DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `temperature` decimal(4,1) DEFAULT NULL, @@ -652,50 +651,14 @@ CREATE TABLE `thermostat` ( PRIMARY KEY (`thermostat_id`), KEY `ecobee_thermostat_id` (`ecobee_thermostat_id`), KEY `user_id` (`user_id`), - KEY `thermostat_group_id` (`thermostat_group_id`), KEY `address_id` (`address_id`), KEY `comparison` (`system_type_heat`,`system_type_cool`,`system_type_heat_stages`,`system_type_cool_stages`,`property_structure_type`,`address_latitude`,`address_longitude`), CONSTRAINT `thermostat_ibfk_1` FOREIGN KEY (`ecobee_thermostat_id`) REFERENCES `ecobee_thermostat` (`ecobee_thermostat_id`) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT `thermostat_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`) ON DELETE RESTRICT ON UPDATE RESTRICT, - CONSTRAINT `thermostat_ibfk_3` FOREIGN KEY (`thermostat_group_id`) REFERENCES `thermostat_group` (`thermostat_group_id`) ON DELETE RESTRICT ON UPDATE RESTRICT, CONSTRAINT `thermostat_ibfk_4` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) ON DELETE RESTRICT ON UPDATE RESTRICT ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; --- --- Table structure for table `thermostat_group` --- - -DROP TABLE IF EXISTS `thermostat_group`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `thermostat_group` ( - `thermostat_group_id` int unsigned NOT NULL AUTO_INCREMENT, - `user_id` int unsigned NOT NULL, - `address_id` int unsigned NOT NULL, - `system_type_heat` enum('geothermal','compressor','boiler','gas','oil','electric','none') CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, - `system_type_heat_auxiliary` enum('electric','gas','oil','none') CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, - `system_type_cool` enum('geothermal','compressor','none') CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, - `property_age` int unsigned DEFAULT NULL, - `property_square_feet` int unsigned DEFAULT NULL, - `property_stories` int unsigned DEFAULT NULL, - `property_structure_type` enum('detached','apartment','condominium','loft','multiplex','townhouse','semi-detached') CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, - `address_latitude` decimal(10,8) DEFAULT NULL, - `address_longitude` decimal(11,8) DEFAULT NULL, - `temperature_profile` json DEFAULT NULL, - `profile` json DEFAULT NULL, - `weather` json DEFAULT NULL, - `deleted` tinyint(1) NOT NULL DEFAULT '0', - PRIMARY KEY (`thermostat_group_id`), - UNIQUE KEY `user_id_address_id` (`user_id`,`address_id`), - KEY `address_id` (`address_id`), - KEY `system_type_heat` (`system_type_heat`,`property_structure_type`,`property_stories`,`property_square_feet`,`property_age`,`address_latitude`,`address_longitude`), - KEY `system_type_cool` (`system_type_cool`,`property_structure_type`,`property_stories`,`property_square_feet`,`property_age`,`address_latitude`,`address_longitude`), - CONSTRAINT `thermostat_group_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `user` (`user_id`), - CONSTRAINT `thermostat_group_ibfk_2` FOREIGN KEY (`address_id`) REFERENCES `address` (`address_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -/*!40101 SET character_set_client = @saved_cs_client */; - -- -- Table structure for table `user` -- diff --git a/js/component/metric/balance_point/heat_2.js b/js/component/metric/balance_point/heat_2.js index b35ccc2..057b091 100644 --- a/js/component/metric/balance_point/heat_2.js +++ b/js/component/metric/balance_point/heat_2.js @@ -4,7 +4,7 @@ * @param {number} thermostat_id The thermostat ID. */ beestat.component.metric.balance_point.heat_2 = function(thermostat_id) { - this.thermostat_group_id_ = thermostat_id; + this.thermostat_id_ = thermostat_id; beestat.component.metric.balance_point.apply(this, arguments); }; diff --git a/js/component/metric/balance_point/resist.js b/js/component/metric/balance_point/resist.js index fe5199f..68ef42e 100644 --- a/js/component/metric/balance_point/resist.js +++ b/js/component/metric/balance_point/resist.js @@ -4,7 +4,7 @@ * @param {number} thermostat_id The thermostat ID. */ beestat.component.metric.balance_point.resist = function(thermostat_id) { - this.thermostat_group_id_ = thermostat_id; + this.thermostat_id_ = thermostat_id; beestat.component.metric.balance_point.apply(this, arguments); }; diff --git a/js/component/metric/runtime_per_degree_day/cool_1.js b/js/component/metric/runtime_per_degree_day/cool_1.js index fc8367b..f6ef014 100644 --- a/js/component/metric/runtime_per_degree_day/cool_1.js +++ b/js/component/metric/runtime_per_degree_day/cool_1.js @@ -4,7 +4,7 @@ * @param {number} thermostat_id The thermostat ID. */ beestat.component.metric.runtime_per_degree_day.cool_1 = function(thermostat_id) { - this.thermostat_group_id_ = thermostat_id; + this.thermostat_id_ = thermostat_id; beestat.component.metric.runtime_per_degree_day.apply(this, arguments); }; diff --git a/js/component/metric/runtime_per_degree_day/cool_2.js b/js/component/metric/runtime_per_degree_day/cool_2.js index 8c8e298..1f9761a 100644 --- a/js/component/metric/runtime_per_degree_day/cool_2.js +++ b/js/component/metric/runtime_per_degree_day/cool_2.js @@ -4,7 +4,7 @@ * @param {number} thermostat_id The thermostat ID. */ beestat.component.metric.runtime_per_degree_day.cool_2 = function(thermostat_id) { - this.thermostat_group_id_ = thermostat_id; + this.thermostat_id_ = thermostat_id; beestat.component.metric.runtime_per_degree_day.apply(this, arguments); }; diff --git a/js/component/metric/runtime_per_degree_day/heat_2.js b/js/component/metric/runtime_per_degree_day/heat_2.js index a616089..08aa2bc 100644 --- a/js/component/metric/runtime_per_degree_day/heat_2.js +++ b/js/component/metric/runtime_per_degree_day/heat_2.js @@ -4,7 +4,7 @@ * @param {number} thermostat_id The thermostat ID. */ beestat.component.metric.runtime_per_degree_day.heat_2 = function(thermostat_id) { - this.thermostat_group_id_ = thermostat_id; + this.thermostat_id_ = thermostat_id; beestat.component.metric.runtime_per_degree_day.apply(this, arguments); };