Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #639

Merged
merged 18 commits into from
Mar 18, 2023
Merged

Dev #639

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
flutter_channel: 'stable' # or: 'dev' or 'beta'
flutter_version: '3.3.6'
flutter_version: '3.7.6'

jobs:
build:
Expand Down
5 changes: 2 additions & 3 deletions assets/translations/be-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
"Smart_Speakers": "Умные колонки",
"Smart_Devices_page": "Страница со Smart-устройствами",
"History": "История",
"Scene": "Сцена",
"Scene": "Сцены",
"Scene": "Сцены",
"Lamps": "Лампы",
"Devices": "Устройства",
"Email_is_required": "Требуется Email-адрес",
Expand Down Expand Up @@ -69,7 +68,7 @@
"Medical": "Медицинские",
"Phones": "Телефоны",
"Speakers": "Колонки",
"Send": "Отправить"
"Send": "Отправить",
"All_Devices": "Все устройства",
"Summary": "Итог",
"Switches": "Переключатели",
Expand Down
2 changes: 1 addition & 1 deletion assets/translations/gj-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"Medical": "મેડિકલ",
"Phones": "ફોન્સ",
"Speakers": "સ્પિકર્સ",
"Send": "મોકલો"
"Send": "મોકલો",
"All_Devices": "બધાઉપકરણો",
"Summary": "સારાંશ",
"Switches": "સ્વીચો",
Expand Down
5 changes: 0 additions & 5 deletions assets/translations/hi-PK.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
"Down": "नीचे",
"Stop": "रुकें",
"Up": "ऊपर",
"Smart_Devices_Settings_Page": "स्मार्ट उपकरण समायोजन पृष्ठ",
"Air_Conditioners": "एयर कंडिशनर",
"Blinds": "चिलमन",
"Smart_Devices_Settings_Page": "स्मार्ट डिवाइस सेटिंग्स पेज",
"Air_Conditioners": "वातानुकूलक",
"Blinds": "पर्देा",
Expand Down Expand Up @@ -52,8 +49,6 @@
"Device_type:_": "उपकरण का प्रकार: {}",
"Room_name_is_required": "कमरे का नाम आवश्यक है",
"Room_name:": "कमरे का नाम:",
"Device_name_is_required": "उपकरण का नाम आवश्यक है",
"Device_name:": "उपकरण का नाम:",
"Device_name_is_required": "यन्त्र का नाम आवश्यक है",
"Device_name:": "यन्त्र का नाम:",
"Update": "अपडेट करें",
Expand Down
223 changes: 111 additions & 112 deletions assets/translations/mr-IN.json
Original file line number Diff line number Diff line change
@@ -1,113 +1,112 @@
{
"Create_new_account": "नवीन खाते तयार करा,"
"Actions_History": "क्रिया इतिहास,"
"Empty_history": "रिकामा इतिहास,"
"History_Settings_Page": "इतिहास सेटिंग्ज पृष्ठ,"
"Lamps_Page": "दिवे पान,"
"Name_": "नाव {},"
"Room_": "खोली {},"
"Lamps_Settings_Page": "दिवे सेटिंग्ज पृष्ठ,"
"Welcome_to_your_Smart_Home": "तुमच्या स्मार्ट होममध्ये स्वागत आहे,"
"Scene_Settings_Page": "दृश्य सेटिंग्ज पृष्ठ,"
"Move_to_blinds_full_settings_page": "आंधळे पूर्ण सेटिंग्ज पृष्ठावर जा,"
"Blinds_Page": "आंधळे पृष्ठ,"
"Down": "खाली,"
"Stop": "थांबा,"
"Up": "वर,"
"Smart_Devices_Settings_Page": "स्मार्ट डिव्हाइस सेटिंग्ज पृष्ठ,"
"Air_Conditioners": "एअर कंडिशनर,"
"Blinds": "पट्ट्या,"
"Medical_Device": "वैद्यकीय उपकरण,"
"Medical_Devices": "वैद्यकीय उपकरणे,"
"Smart_Phone": "स्मार्ट फोन,"
"Smart_Phones": "स्मार्ट फोन,"
"Smart_Speakers": "स्मार्ट स्पीकर्स,"
"Smart_Devices_page": "स्मार्ट उपकरण पृष्ठ,"
"History": "इतिहास,"
"Scene": "देखावा,"
"Scenes": "दृश्ये,"
"Lamps": "दिवे,"
"Devices": "उपकरणे,"
"Email_is_required": "ईमेल आवश्यक आहे,"
"Email_cannot_contain_spaces": "ईमेलमध्ये स्पेस असू शकत नाही,"
"Email_is_invalid": "ईमेल अवैध आहे,"
"Email": "ईमेल,"
"Password_is_required": "पासवर्ड आवश्यक आहे,"
"Password_cannot_contain_spaces": "पासवर्डमध्ये मोकळी जागा असू शकत नाही,"
"Password_must_be_bigger_than__characters": "पासवर्ड {} वर्णांपेक्षा मोठा असणे आवश्यक आहे,"
"Password": "पासवर्ड,"
"Log_In": "लॉग इन,"
"Forgot_password": "पासवर्ड विसरलात,"
"Forgot_password?": "पासवर्ड विसरलात?,"
"title": "शीर्षक,"
"number": "संख्या"
"IP_is_required": "आयपी आवश्यक आहे,"
"IP_syntax_is_incorrect": "IP वाक्यरचना चुकीची आहे,"
"Add_Smart_Device": "स्मार्ट डिव्हाइस जोडा,"
"Cancel": "रद्द करा,"
"Add": "जोडा,"
"Light": "प्रकाश,"
"Device_ip_": "डिव्हाइस ip {},"
"New_devices": "नवीन उपकरणे,"
"Add_devices": "उपकरणे जोडा,"
"Device_type_": "डिव्हाइस प्रकार {},"
"Room_name_is_required": "खोलीचे नाव आवश्यक आहे,"
"Room_name": "खोलीचे नाव,"
"Device_name_is_required": "डिव्हाइसचे नाव आवश्यक आहे,"
"Device_name": "उपकरणाचे नाव ,"
"Update": "अपडेट करा,"
"IP": "आयपी,"
"This_is_firebase": "हे फायरबेस आहे,"
"Device_with_ip_": "ip {} सह उपकरण,"
"Update_WiFi_configuration": "वायफाय कॉन्फिगरेशन अपडेट करा,"
"WiFi_name_is_required": "वायफाय नाव आवश्यक आहे,"
"WiFi_Name": "वायफाय नाव,"
"WiFi_password_is_required": "वायफाय पासवर्ड आवश्यक आहे,"
"WiFi_Password": "वायफाय पासवर्ड,"
"Insert_WiFi_Credentials": "वायफाय क्रेडेन्शियल्स घाला,"
"Conditioners": "कंडिशनर्स,"
"Medical": "वैद्यकीय,"
"Phones": "फोन,"
"Speakers": "वक्ते,"
"Send": "पाठवा,"
"All_Devices": "सर्व उपकरणे,"
"Summary": "सारांश,"
"Switches": "स्विचेस,"
"Boilers": "बॉयलर,"
"Lights": "दिवे,"
"RGBw_Lights": "RGBw दिवे,"
"_Switches": "{} स्विचेस,"
"_SmartTvs": "{} स्मार्टटीव्ही,"
"_RGBW_Lights": "{} RGBW दिवे,"
"_Lights": "{} दिवे,"
"_Boilers": "{} बॉयलर,"
"_Blinds": "{} पट्ट्या,"
"Rooms": "खोल्या,"
"_device": "{} साधन,"
"_devices": "{} उपकरणे,"
"_SmartPlugs": "{} स्मार्टप्लग,"
"On": "चालू,"
"Off": "बंद,"
"Color": "रंग,"
"White": "पांढरा,"
"Area": "क्षेत्रफळ,"
"Areas": "क्षेत्रे,"
"Automations": "ऑटोमेशन,"
"Scenes_In_Folder": "फोल्डरमधील दृश्ये,"
"Select": "निवडा,"
"Exist": "अस्तित्वात आहे,"
"OK": "ठीक आहे,"
"Nothing": "काही नाही,"
"No_need_here": "इथे गरज नाही,"
"Do_not_need": "गरज नाही,"
"Finish": "समाप्त,"
"Select_Purposes_Of_The_Area": "क्षेत्राची उद्दिष्टे निवडा,"
"Pulling_Up_all_blinds": "सर्व पट्ट्या वर खेचणे,"
"Stopping_all_blinds": "सर्व पट्ट्या थांबवून,"
"Pulling_down_all_blinds": "सर्व पट्ट्या खाली खेचणे,"
"Turning_On_boiler": "बॉयलर चालू करणे,"
"Turning_Off_boiler": "बॉयलर बंद करणे,"
"Waiting_for_user_to_get_connected_to_WiFi": "वापरकर्ता वायफायशी कनेक्ट होण्याची वाट पाहत आहे,"
"Can't_add_unsupported_device": "असमर्थित डिव्हाइस जोडू शकत नाही"

}
"Create_new_account": "नवीन खाते तयार करा,",
"Actions_History": "क्रिया इतिहास,",
"Empty_history": "रिकामा इतिहास,",
"History_Settings_Page": "इतिहास सेटिंग्ज पृष्ठ,",
"Lamps_Page": "दिवे पान,",
"Name_": "नाव {},",
"Room_": "खोली {},",
"Lamps_Settings_Page": "दिवे सेटिंग्ज पृष्ठ,",
"Welcome_to_your_Smart_Home": "तुमच्या स्मार्ट होममध्ये स्वागत आहे,",
"Scene_Settings_Page": "दृश्य सेटिंग्ज पृष्ठ,",
"Move_to_blinds_full_settings_page": "आंधळे पूर्ण सेटिंग्ज पृष्ठावर जा,",
"Blinds_Page": "आंधळे पृष्ठ,",
"Down": "खाली,",
"Stop": "थांबा,",
"Up": "वर,",
"Smart_Devices_Settings_Page": "स्मार्ट डिव्हाइस सेटिंग्ज पृष्ठ,",
"Air_Conditioners": "एअर कंडिशनर,",
"Blinds": "पट्ट्या,",
"Medical_Device": "वैद्यकीय उपकरण,",
"Medical_Devices": "वैद्यकीय उपकरणे,",
"Smart_Phone": "स्मार्ट फोन,",
"Smart_Phones": "स्मार्ट फोन,",
"Smart_Speakers": "स्मार्ट स्पीकर्स,",
"Smart_Devices_page": "स्मार्ट उपकरण पृष्ठ,",
"History": "इतिहास,",
"Scene": "देखावा,",
"Scenes": "दृश्ये,",
"Lamps": "दिवे,",
"Devices": "उपकरणे,",
"Email_is_required": "ईमेल आवश्यक आहे,",
"Email_cannot_contain_spaces": "ईमेलमध्ये स्पेस असू शकत नाही,",
"Email_is_invalid": "ईमेल अवैध आहे,",
"Email": "ईमेल,",
"Password_is_required": "पासवर्ड आवश्यक आहे,",
"Password_cannot_contain_spaces": "पासवर्डमध्ये मोकळी जागा असू शकत नाही,",
"Password_must_be_bigger_than__characters": "पासवर्ड {} वर्णांपेक्षा मोठा असणे आवश्यक आहे,",
"Password": "पासवर्ड,",
"Log_In": "लॉग इन,",
"Forgot_password": "पासवर्ड विसरलात,",
"Forgot_password?": "पासवर्ड विसरलात?,",
"title": "शीर्षक,",
"number": "संख्या",
"IP_is_required": "आयपी आवश्यक आहे,",
"IP_syntax_is_incorrect": "IP वाक्यरचना चुकीची आहे,",
"Add_Smart_Device": "स्मार्ट डिव्हाइस जोडा,",
"Cancel": "रद्द करा,",
"Add": "जोडा,",
"Light": "प्रकाश,",
"Device_ip_": "डिव्हाइस ip {},",
"New_devices": "नवीन उपकरणे,",
"Add_devices": "उपकरणे जोडा,",
"Device_type_": "डिव्हाइस प्रकार {},",
"Room_name_is_required": "खोलीचे नाव आवश्यक आहे,",
"Room_name": "खोलीचे नाव,",
"Device_name_is_required": "डिव्हाइसचे नाव आवश्यक आहे,",
"Device_name": "उपकरणाचे नाव ,",
"Update": "अपडेट करा,",
"IP": "आयपी,",
"This_is_firebase": "हे फायरबेस आहे,",
"Device_with_ip_": "ip {} सह उपकरण,",
"Update_WiFi_configuration": "वायफाय कॉन्फिगरेशन अपडेट करा,",
"WiFi_name_is_required": "वायफाय नाव आवश्यक आहे,",
"WiFi_Name": "वायफाय नाव,",
"WiFi_password_is_required": "वायफाय पासवर्ड आवश्यक आहे,",
"WiFi_Password": "वायफाय पासवर्ड,",
"Insert_WiFi_Credentials": "वायफाय क्रेडेन्शियल्स घाला,",
"Conditioners": "कंडिशनर्स,",
"Medical": "वैद्यकीय,",
"Phones": "फोन,",
"Speakers": "वक्ते,",
"Send": "पाठवा,",
"All_Devices": "सर्व उपकरणे,",
"Summary": "सारांश,",
"Switches": "स्विचेस,",
"Boilers": "बॉयलर,",
"Lights": "दिवे,",
"RGBw_Lights": "RGBw दिवे,",
"_Switches": "{} स्विचेस,",
"_SmartTvs": "{} स्मार्टटीव्ही,",
"_RGBW_Lights": "{} RGBW दिवे,",
"_Lights": "{} दिवे,",
"_Boilers": "{} बॉयलर,",
"_Blinds": "{} पट्ट्या,",
"Rooms": "खोल्या,",
"_device": "{} साधन,",
"_devices": "{} उपकरणे,",
"_SmartPlugs": "{} स्मार्टप्लग,",
"On": "चालू,",
"Off": "बंद,",
"Color": "रंग,",
"White": "पांढरा,",
"Area": "क्षेत्रफळ,",
"Areas": "क्षेत्रे,",
"Automations": "ऑटोमेशन,",
"Scenes_In_Folder": "फोल्डरमधील दृश्ये,",
"Select": "निवडा,",
"Exist": "अस्तित्वात आहे,",
"OK": "ठीक आहे,",
"Nothing": "काही नाही,",
"No_need_here": "इथे गरज नाही,",
"Do_not_need": "गरज नाही,",
"Finish": "समाप्त,",
"Select_Purposes_Of_The_Area": "क्षेत्राची उद्दिष्टे निवडा,",
"Pulling_Up_all_blinds": "सर्व पट्ट्या वर खेचणे,",
"Stopping_all_blinds": "सर्व पट्ट्या थांबवून,",
"Pulling_down_all_blinds": "सर्व पट्ट्या खाली खेचणे,",
"Turning_On_boiler": "बॉयलर चालू करणे,",
"Turning_Off_boiler": "बॉयलर बंद करणे,",
"Waiting_for_user_to_get_connected_to_WiFi": "वापरकर्ता वायफायशी कनेक्ट होण्याची वाट पाहत आहे,",
"Can't_add_unsupported_device": "असमर्थित डिव्हाइस जोडू शकत नाही"
}
3 changes: 1 addition & 2 deletions assets/translations/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"Smart_Devices_page": "Страница со Smart-устройствами",
"History": "История",
"Scene": "Сцена",
"Scene": "Сцены",
"Lamps": "Лампы",
"Devices": "Устройства",
"Email_is_required": "Требуется Email-адрес",
Expand Down Expand Up @@ -69,7 +68,7 @@
"Medical": "Медицинские",
"Phones": "Телефоны",
"Speakers": "Колонки",
"Send": "Отправить"
"Send": "Отправить",
"All_Devices": "Все устройства",
"Summary": "Итог",
"Switches": "Переключатели",
Expand Down
2 changes: 1 addition & 1 deletion assets/translations/ta-IN.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"No_need_here": "இங்கே தேவையில்லை",
"Do_not_need": "தேவையில்லை",
"Finish": "முடிக்கவும்",
"Select_Purposes_Of_The_Area": "பகுதியின் நோக்கங்களைத் தேர்ந்தெடுக்கவும்"
"Select_Purposes_Of_The_Area": "பகுதியின் நோக்கங்களைத் தேர்ந்தெடுக்கவும்",
"Pulling_Up_all_blinds": "திரைசீலைகளை உருவுவது",
"Stopping_all_blinds": "திரைசீலைகளை நிருத்துவது",
"Pulling_down_all_blinds": "திரைசீலைகளை இழுப்பது",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import 'dart:async';

import 'package:bloc/bloc.dart';
import 'package:cybear_jinni/domain/vendors/esphome_login/generic_esphome_login_entity.dart';
import 'package:cybear_jinni/domain/vendors/esphome_login/generic_esphome_login_value_objects.dart';
import 'package:cybear_jinni/domain/vendors/i_vendor_repository.dart';
import 'package:cybear_jinni/domain/vendors/login_abstract/core_login_failures.dart';
import 'package:cybear_jinni/domain/vendors/login_abstract/value_login_objects_core.dart';
import 'package:dartz/dartz.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:injectable/injectable.dart';

part 'esphome_sign_in_form_bloc.freezed.dart';
part 'esphome_sign_in_form_event.dart';
part 'esphome_sign_in_form_state.dart';

@injectable
class EspHomeSignInFormBloc
extends Bloc<EspHomeSignInFormEvent, EspHomeSignInFormState> {
EspHomeSignInFormBloc(this._vendorRepository)
: super(EspHomeSignInFormState.initial()) {
on<ApiKeyChanged>(_apiKeyChanged);
on<SignInWithApiKey>(_signInWithApiKey);
}

final IVendorsRepository _vendorRepository;

//
// @override
// SignInFormState get initialStat`e => SignInFormState.initial();

Future<void> _apiKeyChanged(
ApiKeyChanged event,
Emitter<EspHomeSignInFormState> emit,
) async {
emit(
state.copyWith(
espHomeDevicePassword:
GenericEspHomeDeviceLoginApiPass(event.apiKeyStr),
authFailureOrSuccessOption: none(),
),
);
}

Future<void> _signInWithApiKey(
SignInWithApiKey event,
Emitter<EspHomeSignInFormState> emit,
) async {
final GenericEspHomeLoginDE genericEspHomeDE = GenericEspHomeLoginDE(
senderUniqueId: CoreLoginSenderId.fromUniqueString('Me'),
espHomeDevicePass: GenericEspHomeDeviceLoginApiPass(
state.espHomeDevicePassword.getOrCrash()),
);
_vendorRepository.loginWithEspHome(genericEspHomeDE);
// emit(* _performActionOnAuthFacadeWithEmailAndPassword(
// _authFacade.registerWithEmailAndPassword,
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
part of 'esphome_sign_in_form_bloc.dart';

@freezed
class EspHomeSignInFormEvent with _$EspHomeSignInFormEvent {
const factory EspHomeSignInFormEvent.apiKeyChanged(String apiKeyStr) =
ApiKeyChanged;

const factory EspHomeSignInFormEvent.signInWithApiKey() = SignInWithApiKey;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
part of 'esphome_sign_in_form_bloc.dart';

@freezed
class EspHomeSignInFormState with _$EspHomeSignInFormState {
const factory EspHomeSignInFormState({
required GenericEspHomeDeviceLoginApiPass espHomeDevicePassword,
required bool showErrorMessages,
required bool isSubmitting,
required Option<Either<CoreLoginFailure, Unit>> authFailureOrSuccessOption,
}) = _EspHomeSignInFormState;

factory EspHomeSignInFormState.initial() => EspHomeSignInFormState(
espHomeDevicePassword: GenericEspHomeDeviceLoginApiPass(''),
showErrorMessages: false,
isSubmitting: false,
authFailureOrSuccessOption: none(),
);
}
Loading