1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-25 14:42:21 +01:00

Lint more filetypes

This commit is contained in:
Otto Winter
2019-05-08 15:26:44 +02:00
parent 3fe9c20188
commit 3372ddc63d
2 changed files with 13 additions and 3 deletions

View File

@@ -10,8 +10,8 @@ ESP_PLATFORMS = [ESP_PLATFORM_ESP32]
def validate_frequency_bit_depth(obj):
frequency = obj.get(CONF_FREQUENCY, 1000)
bit_depth = obj.get(CONF_BIT_DEPTH, 12)
frequency = obj[CONF_FREQUENCY]
bit_depth = obj[CONF_BIT_DEPTH]
max_freq = APB_CLOCK_FREQ / (2**bit_depth)
if frequency > max_freq:
raise cv.Invalid('Maximum frequency for bit depth {} is {}Hz'.format(bit_depth, max_freq))