homie-mqtt 1.6.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ac2d4aeded4ffe715b8de38705b648c3aa2c80d378f57435f7e5bd854f8eac22
4
- data.tar.gz: d4503b114004ebed3cd4987ecc1466ff0c3e6637d474477fb8f9e43eaf4e91b0
3
+ metadata.gz: d70ea4b44d22d3f2b5348e3e30b4ec4d624b0e3679f9f8da28813563a9296616
4
+ data.tar.gz: 1a7d48f60cc074d9f38a1190fd60e2a6df53f815ca733610ce32aef58c494a1e
5
5
  SHA512:
6
- metadata.gz: 02f74510916e8fb1d0ef8d40b3aea41320e9e12973175fb41b004598ab84038f16df3b171bf0c88e22e8fa894096871de17add5ca5aa37194bbda27e1cadecae
7
- data.tar.gz: ffe27a55cf9e3e561a9469b17931b989e589a319b3e9e1aa976641640510bcbabe7f71988688922bd7ce77077f79f50ccf85f742a08d34bd73667bfc93eca5fc
6
+ metadata.gz: '0119a668ccb19e5568d52c8dad148f882a9a17b8913c6f523e5b84c32f738c87437e0d765d780e771bc0b477cbf4bc9287e3004f258185ee1e6b9595de3c1641'
7
+ data.tar.gz: 4be69c2086e1ad51e67972858a6f3d37a84b73ca247c2e37ae6a436934b87130499e04f9fd9e813f626f1a6e667c60e424c5360b45f18bc0b386717ea5738f69
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "time"
4
+
3
5
  module MQTT
4
6
  module Homie
5
7
  class Property < Base
@@ -158,7 +160,9 @@ module MQTT
158
160
  end
159
161
  end
160
162
  case datatype
161
- when :integer, :float, :enum
163
+ when :integer, :float
164
+ casted_value = nil if format && !range.cover?(casted_value)
165
+ when :enum
162
166
  casted_value = nil if format && !range.include?(casted_value)
163
167
  when :color
164
168
  casted_value = nil if (format == "rgb" && value.max > 255) ||
@@ -2,6 +2,6 @@
2
2
 
3
3
  module MQTT
4
4
  module Homie
5
- VERSION = "1.6.0"
5
+ VERSION = "1.6.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homie-mqtt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-09 00:00:00.000000000 Z
11
+ date: 2022-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mqtt-ccutrer