Skip to content

Commit

Permalink
Comment Latitude & Longitude
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Nov 12, 2024
1 parent c119705 commit 115ad52
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions components/nuki_lock/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
CONF_LED_BRIGHTNESS_NUMBER = "led_brightness"
CONF_SECURITY_PIN_NUMBER = "security_pin"
CONF_TIMEZONE_OFFSET_NUMBER = "timezone_offset"
CONF_LATITUDE_NUMBER = "latitude"
CONF_LONGITUDE_NUMBER = "longitude"
#CONF_LATITUDE_NUMBER = "latitude"
#CONF_LONGITUDE_NUMBER = "longitude"

CONF_BUTTON_PRESS_ACTION_SELECT_OPTIONS = [
"No Action",
Expand Down Expand Up @@ -167,8 +167,8 @@
NukiLockLedBrightnessNumber = nuki_lock_ns.class_("NukiLockLedBrightnessNumber", number.Number, cg.Component)
NukiLockSecurityPinNumber = nuki_lock_ns.class_("NukiLockSecurityPinNumber", number.Number, cg.Component)
NukiLockTimeZoneOffsetNumber = nuki_lock_ns.class_("NukiLockTimeZoneOffsetNumber", number.Number, cg.Component)
NukiLockLatitudeNumber = nuki_lock_ns.class_("NukiLockLatitudeNumber", number.Number, cg.Component)
NukiLockLongitudeNumber = nuki_lock_ns.class_("NukiLockLongitudeNumber", number.Number, cg.Component)
#NukiLockLatitudeNumber = nuki_lock_ns.class_("NukiLockLatitudeNumber", number.Number, cg.Component)
#NukiLockLongitudeNumber = nuki_lock_ns.class_("NukiLockLongitudeNumber", number.Number, cg.Component)

NukiLockSingleButtonPressActionSelect = nuki_lock_ns.class_("NukiLockSingleButtonPressActionSelect", select.Select, cg.Component)
NukiLockDoubleButtonPressActionSelect = nuki_lock_ns.class_("NukiLockDoubleButtonPressActionSelect", select.Select, cg.Component)
Expand Down Expand Up @@ -333,16 +333,16 @@
entity_category=ENTITY_CATEGORY_CONFIG,
icon="mdi:clock-end",
),
cv.Optional(CONF_LATITUDE_NUMBER): number.number_schema(
NukiLockLatitudeNumber,
entity_category=ENTITY_CATEGORY_CONFIG,
icon="mdi:map",
).extend({ cv.Optional(CONF_MODE, default="BOX"): cv.enum(NUMBER_MODES, upper=True), }),
cv.Optional(CONF_LONGITUDE_NUMBER): number.number_schema(
NukiLockLongitudeNumber,
entity_category=ENTITY_CATEGORY_CONFIG,
icon="mdi:map",
).extend({ cv.Optional(CONF_MODE, default="BOX"): cv.enum(NUMBER_MODES, upper=True), }),
#cv.Optional(CONF_LATITUDE_NUMBER): number.number_schema(
# NukiLockLatitudeNumber,
# entity_category=ENTITY_CATEGORY_CONFIG,
# icon="mdi:map",
#).extend({ cv.Optional(CONF_MODE, default="BOX"): cv.enum(NUMBER_MODES, upper=True), }),
#cv.Optional(CONF_LONGITUDE_NUMBER): number.number_schema(
# NukiLockLongitudeNumber,
# entity_category=ENTITY_CATEGORY_CONFIG,
# icon="mdi:map",
#).extend({ cv.Optional(CONF_MODE, default="BOX"): cv.enum(NUMBER_MODES, upper=True), }),

cv.Optional(CONF_SINGLE_BUTTON_PRESS_ACTION_SELECT): select.select_schema(
NukiLockSingleButtonPressActionSelect,
Expand Down Expand Up @@ -472,19 +472,19 @@ async def to_code(config):
await cg.register_parented(n, config[CONF_ID])
cg.add(var.set_timezone_offset_number(n))

if latitude := config.get(CONF_LATITUDE_NUMBER):
n = await number.new_number(
latitude, min_value=0.0000000, max_value=90.0000000, step=0.0000001
)
await cg.register_parented(n, config[CONF_ID])
cg.add(var.set_latitude_number(n))

if longitude := config.get(CONF_LONGITUDE_NUMBER):
n = await number.new_number(
longitude, min_value=0.0000000, max_value=180.0000000, step=0.0000001
)
await cg.register_parented(n, config[CONF_ID])
cg.add(var.set_longitude_number(n))
#if latitude := config.get(CONF_LATITUDE_NUMBER):
# n = await number.new_number(
# latitude, min_value=0.0000000, max_value=90.0000000, step=0.0000001
# )
# await cg.register_parented(n, config[CONF_ID])
# cg.add(var.set_latitude_number(n))

#if longitude := config.get(CONF_LONGITUDE_NUMBER):
# n = await number.new_number(
# longitude, min_value=0.0000000, max_value=180.0000000, step=0.0000001
# )
# await cg.register_parented(n, config[CONF_ID])
# cg.add(var.set_longitude_number(n))

# Switch
if pairing_mode := config.get(CONF_PAIRING_MODE_SWITCH):
Expand Down

0 comments on commit 115ad52

Please sign in to comment.