-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
919 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,4 +82,5 @@ jobs: | |
--durations=10 \ | ||
-n auto \ | ||
-p no:sugar \ | ||
-rA \ | ||
tests |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
"""Additional enumerated values to use in home assistant.""" | ||
from enum import Enum | ||
|
||
|
||
class HAChargerServices(str, Enum): | ||
"""Charger status conditions to report in home assistant.""" | ||
|
||
"""For HA service reference use .name for function to call use .value""" | ||
|
||
service_charge_start = "start_transaction" | ||
service_charge_stop = "stop_transaction" | ||
service_availability = "availability" | ||
service_set_charge_rate = "set_charge_rate" | ||
service_reset = "reset" | ||
service_unlock = "unlock" | ||
service_update_firmware = "update_firmware" | ||
service_configure = "configure" | ||
service_get_configuration = "get_configuration" | ||
service_clear_profile = "clear_profile" | ||
|
||
|
||
class HAChargerStatuses(str, Enum): | ||
"""Charger status conditions to report in home assistant.""" | ||
|
||
status = "Status" | ||
heartbeat = "Heartbeat" | ||
error_code = "Error.Code" | ||
stop_reason = "Stop.Reason" | ||
firmware_status = "FW.Status" | ||
|
||
|
||
class HAChargerDetails(str, Enum): | ||
"""Charger nameplate information to report in home assistant.""" | ||
|
||
identifier = "ID" | ||
model = "Model" | ||
vendor = "Vendor" | ||
serial = "Serial" | ||
firmware_version = "FW.Version" | ||
features = "Features" | ||
connectors = "Connectors" | ||
|
||
|
||
class HAChargerSession(str, Enum): | ||
"""Charger session information to report in home assistant.""" | ||
|
||
transaction_id = "Transaction.Id" | ||
session_time = "Session.Time" # in min | ||
session_energy = "Session.Energy" # in kWh | ||
meter_start = "Meter.Start" # in kWh | ||
|
||
|
||
class OcppMisc(str, Enum): | ||
"""Miscellaneous strings used in ocpp v1.6 responses.""" | ||
|
||
"""For pythonic version use .name (eg with kwargs) for ocpp json use .value""" | ||
|
||
limit = "limit" | ||
measurand = "measurand" | ||
reason = "reason" | ||
readonly = "readonly" | ||
status = "status" | ||
transaction_id = "transactionId" | ||
charge_point_serial_number = "chargePointSerialNumber" | ||
charge_point_vendor = "chargePointVendor" | ||
charge_point_model = "chargePointModel" | ||
firmware_version = "firmwareVersion" | ||
charging_profile_id = "chargingProfileId" | ||
stack_level = "stackLevel" | ||
charging_profile_kind = "chargingProfileKind" | ||
charging_profile_purpose = "chargingProfilePurpose" | ||
charging_schedule = "chargingSchedule" | ||
charging_rate_unit = "chargingRateUnit" | ||
charging_schedule_period = "chargingSchedulePeriod" | ||
start_period = "startPeriod" | ||
feature_profile_core = "Core" | ||
feature_profile_firmware = "FirmwareManagement" | ||
feature_profile_smart = "SmartCharging" | ||
feature_profile_reservation = "Reservation" | ||
feature_profile_remote = "RemoteTrigger" | ||
feature_profile_auth = "LocalAuthListManagement" | ||
|
||
# for use with Smart Charging | ||
current = "Current" | ||
power = "Power" | ||
|
||
|
||
class ConfigurationKey(str, Enum): | ||
"""Configuration Key Names.""" | ||
|
||
# 9.1 Core Profile | ||
allow_offline_tx_for_unknown_id = "AllowOfflineTxForUnknownId" | ||
authorization_cache_enabled = "AuthorizationCacheEnabled" | ||
authorize_remote_tx_requests = "AuthorizeRemoteTxRequests" | ||
blink_repeat = "BlinkRepeat" | ||
clock_aligned_data_interval = "ClockAlignedDataInterval" | ||
connection_time_out = "ConnectionTimeOut" | ||
connector_phase_rotation = "ConnectorPhaseRotation" | ||
connector_phase_rotation_max_length = "ConnectorPhaseRotationMaxLength" | ||
get_configuration_max_keys = "GetConfigurationMaxKeys" | ||
heartbeat_interval = "HeartbeatInterval" | ||
light_intensity = "LightIntensity" | ||
local_authorize_offline = "LocalAuthorizeOffline" | ||
local_pre_authorize = "LocalPreAuthorize" | ||
max_energy_on_invalid_id = "MaxEnergyOnInvalidId" | ||
meter_values_aligned_data = "MeterValuesAlignedData" | ||
meter_values_aligned_data_max_length = "MeterValuesAlignedDataMaxLength" | ||
meter_values_sampled_data = "MeterValuesSampledData" | ||
meter_values_sampled_data_max_length = "MeterValuesSampledDataMaxLength" | ||
meter_value_sample_interval = "MeterValueSampleInterval" | ||
minimum_status_duration = "MinimumStatusDuration" | ||
number_of_connectors = "NumberOfConnectors" | ||
reset_retries = "ResetRetries" | ||
stop_transaction_on_ev_side_disconnect = "StopTransactionOnEVSideDisconnect" | ||
stop_transaction_on_invalid_id = "StopTransactionOnInvalidId" | ||
stop_txn_aligned_data = "StopTxnAlignedData" | ||
stop_txn_aligned_data_max_length = "StopTxnAlignedDataMaxLength" | ||
stop_txn_sampled_data = "StopTxnSampledData" | ||
stop_txn_sampled_data_max_length = "StopTxnSampledDataMaxLength" | ||
supported_feature_profiles = "SupportedFeatureProfiles" | ||
supported_feature_profiles_max_length = "SupportedFeatureProfilesMaxLength" | ||
transaction_message_attempts = "TransactionMessageAttempts" | ||
transaction_message_retry_interval = "TransactionMessageRetryInterval" | ||
unlock_connector_on_ev_side_disconnect = "UnlockConnectorOnEVSideDisconnect" | ||
web_socket_ping_interval = "WebSocketPingInterval" | ||
|
||
# 9.2 Local Auth List Management Profile | ||
local_auth_list_enabled = "LocalAuthListEnabled" | ||
local_auth_list_max_length = "LocalAuthListMaxLength" | ||
send_local_list_max_length = "SendLocalListMaxLength" | ||
|
||
# 9.3 Reservation Profile | ||
reserve_connector_zero_supported = "ReserveConnectorZeroSupported" | ||
|
||
# 9.4 Smart Charging Profile | ||
charge_profile_max_stack_level = "ChargeProfileMaxStackLevel" | ||
charging_schedule_allowed_charging_rate_unit = ( | ||
"ChargingScheduleAllowedChargingRateUnit" | ||
) | ||
charging_schedule_max_periods = "ChargingScheduleMaxPeriods" | ||
connector_switch_3to1_phase_supported = "ConnectorSwitch3to1PhaseSupported" | ||
max_charging_profiles_installed = "MaxChargingProfilesInstalled" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,83 @@ | ||
# Service ID | ||
#start_charge: | ||
set_charge_rate: | ||
# Service name as shown in UI | ||
# name: Start charging | ||
name: Set maximum charge rate | ||
# Description of the service | ||
# description: Starts a charge session | ||
description: Sets the maximum charge rate in Amps or Watts (dependent on charger support) | ||
# If the service accepts entity IDs, target allows the user to specify entities by entity, device, or area. If `target` is specified, `entity_id` should not be defined in the `fields` map. By default it shows only targets matching entities from the same domain as the service, but if further customization is required, target supports the entity, device, and area selectors (https://www.home-assistant.io/docs/blueprint/selectors/). Entity selector parameters will automatically be applied to device and area, and device selector parameters will automatically be applied to area. | ||
# target: | ||
#target: | ||
# entity: | ||
# integration: ocpp | ||
# Different fields that your service accepts | ||
# limit: | ||
fields: | ||
# Key of the field | ||
limit_amps: | ||
# Field name as shown in UI | ||
# name: Charge limit | ||
name: Limit (A) | ||
# Description of the field | ||
# description: Maximum charge rate in W | ||
description: Maximum charge rate in Amps | ||
# Whether or not field is required (default = false) | ||
# required: false | ||
required: false | ||
# Advanced fields are only shown when the advanced mode is enabled for the user (default = false) | ||
# advanced: false | ||
advanced: true | ||
# Example value that can be passed for this field | ||
# example: "1500" | ||
example: 16 | ||
# The default field value | ||
# default: "22000" | ||
default: 32 | ||
limit_watts: | ||
name: Limit (W) | ||
description: Maximum charge rate in Watts | ||
required: false | ||
advanced: true | ||
example: 1500 | ||
default: 22000 | ||
|
||
#stop_charge: | ||
# name: Stop charging | ||
# description: Stops a charge session in progress | ||
# target: | ||
# entity: | ||
# integration: ocpp | ||
clear_profile: | ||
name: Clear charging profiles | ||
description: Clears all charging profiles (limits) set (dependent on charger support) | ||
|
||
update_firmware: | ||
name: Update charger firmware | ||
description: Specify server to download firmware and time to delay updating (dependent on charger support) | ||
fields: | ||
firmware_url: | ||
name: Url of firmware | ||
description: Full url of firmware file (http or https) | ||
required: true | ||
advanced: true | ||
example: "http://www.charger.com/firmware.bin" | ||
delay_hours: | ||
name: Delay hours | ||
description: Hours to delay charger update | ||
required: false | ||
advanced: true | ||
example: 12 | ||
default: 0 | ||
|
||
configure: | ||
name: Configure charger features | ||
description: Change supported Ocpp v1.6 configuration values | ||
fields: | ||
ocpp_key: | ||
name: Configuration key name | ||
description: Write-enabled key name supported | ||
required: true | ||
advanced: true | ||
example: "WebSocketPingInterval" | ||
value: | ||
name: Key value | ||
description: Value to write to key | ||
required: true | ||
advanced: true | ||
example: "60" | ||
|
||
get_configuration: | ||
name: Get configuration values for charger | ||
description: Change supported Ocpp v1.6 configuration values | ||
fields: | ||
ocpp_key: | ||
name: Configuration key name | ||
description: Key name supported | ||
required: true | ||
advanced: true | ||
example: "WebSocketPingInterval" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,4 @@ branch = False | |
|
||
[coverage:report] | ||
show_missing = true | ||
fail_under = 100 | ||
fail_under = 75 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.