def test_xl824_2(self): """Get methods for an xl824 thermostat.""" nexia = NexiaHome(auto_login=False) devices_json = json.loads(load_fixture("mobile_house_xl624.json")) nexia.update_from_json(devices_json) thermostat_ids = nexia.get_thermostat_ids() self.assertEqual(thermostat_ids, [2222222, 3333333]) thermostat = nexia.get_thermostat_by_id(3333333) self.assertEqual(thermostat.get_model(), "XL824") self.assertEqual(thermostat.get_firmware(), "5.9.1") self.assertEqual(thermostat.get_dev_build_number(), "1581314625") self.assertEqual(thermostat.get_device_id(), "01573380") self.assertEqual(thermostat.get_type(), "XL824") self.assertEqual(thermostat.get_name(), "Upstairs") self.assertEqual(thermostat.get_deadband(), 3) self.assertEqual(thermostat.get_setpoint_limits(), (55, 99)) self.assertEqual(thermostat.has_variable_fan_speed(), True) self.assertEqual(thermostat.get_unit(), "F") self.assertEqual(thermostat.get_humidity_setpoint_limits(), (0.35, 0.65)) self.assertEqual(thermostat.get_fan_mode(), "Circulate") self.assertEqual(thermostat.get_fan_modes(), ["Auto", "On", "Circulate"]) self.assertEqual(thermostat.get_current_compressor_speed(), 0.0) self.assertEqual(thermostat.get_requested_compressor_speed(), 0.0) self.assertEqual(thermostat.has_dehumidify_support(), True) self.assertEqual(thermostat.has_humidify_support(), False) self.assertEqual(thermostat.has_emergency_heat(), False) self.assertEqual(thermostat.get_system_status(), "System Idle") self.assertEqual(thermostat.has_air_cleaner(), True) self.assertEqual(thermostat.is_blower_active(), False) zone_ids = thermostat.get_zone_ids() self.assertEqual(zone_ids, [99999999])
def test_xl824_idle(self): """Tests for nexia xl824 zone idle.""" nexia = NexiaHome(auto_login=False) devices_json = json.loads(load_fixture("mobile_house_xl624.json")) nexia.update_from_json(devices_json) thermostat_ids = nexia.get_thermostat_ids() self.assertEqual(thermostat_ids, [2222222, 3333333]) thermostat = nexia.get_thermostat_by_id(3333333) zone = thermostat.get_zone_by_id(99999999) self.assertEqual(zone.get_name(), "Upstairs NativeZone") self.assertEqual(zone.get_cooling_setpoint(), 74) self.assertEqual(zone.get_heating_setpoint(), 62) self.assertEqual(zone.get_current_mode(), "COOL") self.assertEqual( zone.get_requested_mode(), "COOL", ) self.assertEqual( zone.get_presets(), ["None", "Home", "Away", "Sleep"], ) self.assertEqual( zone.get_preset(), "None", ) self.assertEqual( zone.get_status(), "Idle", ) self.assertEqual( zone.get_setpoint_status(), "Permanent Hold", ) self.assertEqual(zone.is_calling(), False) self.assertEqual(zone.is_in_permanent_hold(), True)
def test_xl624(self): """Get methods for an xl624 thermostat.""" nexia = NexiaHome(auto_login=False) devices_json = json.loads(load_fixture("mobile_house_xl624.json")) nexia.update_from_json(devices_json) thermostat_ids = nexia.get_thermostat_ids() self.assertEqual(thermostat_ids, [2222222, 3333333]) thermostat = nexia.get_thermostat_by_id(1111111) self.assertEqual(thermostat.get_model(), None) self.assertEqual(thermostat.get_firmware(), "2.8") self.assertEqual(thermostat.get_dev_build_number(), "0603340208") self.assertEqual(thermostat.get_device_id(), None) self.assertEqual(thermostat.get_type(), None) self.assertEqual(thermostat.get_name(), "Downstairs Hall") self.assertEqual(thermostat.get_deadband(), 3) self.assertEqual(thermostat.get_setpoint_limits(), (55, 99)) self.assertEqual(thermostat.has_variable_fan_speed(), False) self.assertEqual(thermostat.get_unit(), "F") self.assertEqual(thermostat.get_humidity_setpoint_limits(), (0.35, 0.65)) self.assertEqual(thermostat.get_fan_mode(), "Auto") self.assertEqual(thermostat.get_fan_modes(), ["Auto", "On", "Cycler"]) self.assertEqual(thermostat.get_current_compressor_speed(), 0.0) self.assertEqual(thermostat.get_requested_compressor_speed(), 0.0) self.assertEqual(thermostat.has_dehumidify_support(), False) self.assertEqual(thermostat.has_humidify_support(), False) self.assertEqual(thermostat.has_emergency_heat(), False) self.assertEqual(thermostat.get_system_status(), "System Idle") self.assertEqual(thermostat.has_air_cleaner(), False) self.assertEqual(thermostat.is_blower_active(), False) zone_ids = thermostat.get_zone_ids() self.assertEqual(zone_ids, [12345678])
def test_basic_issue_33758(self): """Basic tests for NexiaHome.""" nexia = NexiaHome(auto_login=False) devices_json = json.loads(load_fixture("mobile_house_issue_33758.json")) nexia.update_from_json(devices_json) self.assertEqual(nexia.get_name(), "Hidden") thermostat_ids = nexia.get_thermostat_ids() self.assertEqual(thermostat_ids, [12345678])
def test_basic(self): """Basic tests for NexiaHome.""" nexia = NexiaHome(auto_login=False) devices_json = json.loads(load_fixture("mobile_houses_123456.json")) nexia.update_from_json(devices_json) self.assertEqual(nexia.get_name(), "Hidden") thermostat_ids = nexia.get_thermostat_ids() self.assertEqual(thermostat_ids, [2059661, 2059676, 2293892, 2059652])
def test_idle_thermo_issue_33968_thermostat_1690380(self): """Get methods for an cooling thermostat.""" nexia = NexiaHome(auto_login=False) devices_json = json.loads( load_fixture("mobile_house_issue_33968.json")) nexia.update_from_json(devices_json) thermostat_ids = nexia.get_thermostat_ids() self.assertEqual(thermostat_ids, [1690380]) thermostat = nexia.get_thermostat_by_id(1690380) zone_ids = thermostat.get_zone_ids() self.assertEqual(zone_ids, [83037337, 83037340, 83037343]) self.assertEqual(thermostat.get_model(), "XL1050") self.assertEqual(thermostat.get_firmware(), "5.9.1") self.assertEqual(thermostat.get_dev_build_number(), "1581321824") self.assertEqual(thermostat.get_device_id(), "removed") self.assertEqual(thermostat.get_type(), "XL1050") self.assertEqual(thermostat.get_name(), "Thermostat") self.assertEqual(thermostat.get_deadband(), 3) self.assertEqual(thermostat.get_setpoint_limits(), (55, 99)) self.assertEqual(thermostat.get_variable_fan_speed_limits(), (0.35, 1.0)) self.assertEqual(thermostat.get_unit(), "F") self.assertEqual(thermostat.get_humidity_setpoint_limits(), (0.35, 0.65)) self.assertEqual(thermostat.get_fan_mode(), "Auto") self.assertEqual(thermostat.get_fan_modes(), ["Auto", "On", "Circulate"]) self.assertEqual(thermostat.get_outdoor_temperature(), 80.0) self.assertEqual(thermostat.get_relative_humidity(), 0.55) self.assertEqual(thermostat.get_current_compressor_speed(), 0.41) self.assertEqual(thermostat.get_requested_compressor_speed(), 0.41) self.assertEqual(thermostat.get_fan_speed_setpoint(), 0.5) self.assertEqual(thermostat.get_dehumidify_setpoint(), 0.55) self.assertEqual(thermostat.has_dehumidify_support(), True) self.assertEqual(thermostat.has_humidify_support(), False) self.assertEqual(thermostat.has_emergency_heat(), True) self.assertEqual(thermostat.is_emergency_heat_active(), False) self.assertEqual(thermostat.get_system_status(), "Cooling") self.assertEqual(thermostat.has_air_cleaner(), True) self.assertEqual(thermostat.get_air_cleaner_mode(), "auto") self.assertEqual(thermostat.is_blower_active(), True)
parser.add_argument("--username", type=str, help="Your Nexia username/email address.") parser.add_argument("--password", type=str, help="Your Nexia password.") args = parser.parse_args() if args.username and args.password: nexia_home = NexiaHome(username=args.username, password=args.password) else: parser.print_help() exit() print("NexiaThermostat instance can be referenced using nt.<command>.") print("List of available thermostats and zones:") for _thermostat_id in nexia_home.get_thermostat_ids(): thermostat = nexia_home.get_thermostat_by_id(_thermostat_id) _thermostat_name = thermostat.get_name() _thermostat_model = thermostat.get_model() _thermostat_compressor_speed = thermostat.get_current_compressor_speed() print( f'{_thermostat_id} - "{_thermostat_name}" ({_thermostat_model}) [{_thermostat_compressor_speed}]' ) print(" Zones:") for _zone_id in thermostat.get_zone_ids(): zone = thermostat.get_zone_by_id(_zone_id) _zone_name = zone.get_name() _zone_status = zone.get_status()